mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
Avoid unnecessary match
This commit is contained in:
parent
4f196f66fc
commit
837b4c3462
@ -160,23 +160,19 @@ impl FeedbackModal {
|
||||
editor
|
||||
});
|
||||
|
||||
cx.subscribe(
|
||||
&feedback_editor,
|
||||
|this, editor, event: &EditorEvent, cx| match event {
|
||||
EditorEvent::Edited => {
|
||||
this.character_count = editor
|
||||
.read(cx)
|
||||
.buffer()
|
||||
.read(cx)
|
||||
.as_singleton()
|
||||
.expect("Feedback editor is never a multi-buffer")
|
||||
.read(cx)
|
||||
.len() as i32;
|
||||
cx.notify();
|
||||
}
|
||||
_ => {}
|
||||
},
|
||||
)
|
||||
cx.subscribe(&feedback_editor, |this, editor, event: &EditorEvent, cx| {
|
||||
if *event == EditorEvent::Edited {
|
||||
this.character_count = editor
|
||||
.read(cx)
|
||||
.buffer()
|
||||
.read(cx)
|
||||
.as_singleton()
|
||||
.expect("Feedback editor is never a multi-buffer")
|
||||
.read(cx)
|
||||
.len() as i32;
|
||||
cx.notify();
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
|
||||
Self {
|
||||
|
Loading…
Reference in New Issue
Block a user