mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-16 15:11:25 +00:00
Avoid unnecessary match
This commit is contained in:
parent
4f196f66fc
commit
837b4c3462
1 changed files with 13 additions and 17 deletions
|
@ -160,23 +160,19 @@ impl FeedbackModal {
|
||||||
editor
|
editor
|
||||||
});
|
});
|
||||||
|
|
||||||
cx.subscribe(
|
cx.subscribe(&feedback_editor, |this, editor, event: &EditorEvent, cx| {
|
||||||
&feedback_editor,
|
if *event == EditorEvent::Edited {
|
||||||
|this, editor, event: &EditorEvent, cx| match event {
|
this.character_count = editor
|
||||||
EditorEvent::Edited => {
|
.read(cx)
|
||||||
this.character_count = editor
|
.buffer()
|
||||||
.read(cx)
|
.read(cx)
|
||||||
.buffer()
|
.as_singleton()
|
||||||
.read(cx)
|
.expect("Feedback editor is never a multi-buffer")
|
||||||
.as_singleton()
|
.read(cx)
|
||||||
.expect("Feedback editor is never a multi-buffer")
|
.len() as i32;
|
||||||
.read(cx)
|
cx.notify();
|
||||||
.len() as i32;
|
}
|
||||||
cx.notify();
|
})
|
||||||
}
|
|
||||||
_ => {}
|
|
||||||
},
|
|
||||||
)
|
|
||||||
.detach();
|
.detach();
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
|
|
Loading…
Reference in a new issue