Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Avoid unnecessary match

Joseph T. Lyons837b4c3462c5
diff --git a/crates/feedback2/src/feedback_modal.rs b/crates/feedback2/src/feedback_modal.rs
index 50d55b417fd..5f9b6c4120b 100644
--- a/crates/feedback2/src/feedback_modal.rs
+++ b/crates/feedback2/src/feedback_modal.rs
@@ -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 {