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,10 +160,8 @@ impl FeedbackModal {
|
|||
editor
|
||||
});
|
||||
|
||||
cx.subscribe(
|
||||
&feedback_editor,
|
||||
|this, editor, event: &EditorEvent, cx| match event {
|
||||
EditorEvent::Edited => {
|
||||
cx.subscribe(&feedback_editor, |this, editor, event: &EditorEvent, cx| {
|
||||
if *event == EditorEvent::Edited {
|
||||
this.character_count = editor
|
||||
.read(cx)
|
||||
.buffer()
|
||||
|
@ -174,9 +172,7 @@ impl FeedbackModal {
|
|||
.len() as i32;
|
||||
cx.notify();
|
||||
}
|
||||
_ => {}
|
||||
},
|
||||
)
|
||||
})
|
||||
.detach();
|
||||
|
||||
Self {
|
||||
|
|
Loading…
Reference in a new issue