Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
gpui: Impl Default for ClickEvent (#35751)
Anthony Eidf1e69f631171
diff --git a/crates/gpui/src/interactive.rs b/crates/gpui/src/interactive.rsindex 46af946e694..218ae5fcdfb 100644--- a/crates/gpui/src/interactive.rs+++ b/crates/gpui/src/interactive.rs@@ -150,7 +150,7 @@ pub struct MouseClickEvent {}/// A click event that was generated by a keyboard button being pressed and released.-#[derive(Clone, Debug)]+#[derive(Clone, Debug, Default)]pub struct KeyboardClickEvent {/// The keyboard button that was pressed to trigger the click.pub button: KeyboardButton,@@ -168,6 +168,12 @@ pub enum ClickEvent {Keyboard(KeyboardClickEvent),}+impl Default for ClickEvent {+ fn default() -> Self {+ ClickEvent::Keyboard(KeyboardClickEvent::default())+ }+}+impl ClickEvent {/// Returns the modifiers that were held during the click event///@@ -256,9 +262,10 @@ impl ClickEvent {}/// An enum representing the keyboard button that was pressed for a click event.-#[derive(Hash, PartialEq, Eq, Copy, Clone, Debug)]+#[derive(Hash, PartialEq, Eq, Copy, Clone, Debug, Default)]pub enum KeyboardButton {/// Enter key was clicked+ #[default]Enter,/// Space key was clickedSpace,