From a2aec87049415030c08857675a3fe17e04e5f0fe Mon Sep 17 00:00:00 2001 From: aman tiwari Date: Sun, 6 Feb 2022 17:21:23 +0000 Subject: [PATCH] docstring triple slash --- egui/src/input_state.rs | 4 ++-- egui_demo_lib/src/easy_mark/easy_mark_editor.rs | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/egui/src/input_state.rs b/egui/src/input_state.rs index 3f5e1cc13efe..486cec9d264e 100644 --- a/egui/src/input_state.rs +++ b/egui/src/input_state.rs @@ -192,8 +192,8 @@ impl InputState { self.pointer.wants_repaint() || self.scroll_delta != Vec2::ZERO || !self.events.is_empty() } - // Ignore a key if it was pressed or released this frame. Useful for hotkeys. - // Returns if the key was pressed this frame + /// Ignore a key if it was pressed or released this frame. Useful for hotkeys. + /// Returns if the key was pressed this frame pub fn consume_key(&mut self, modifiers: Modifiers, key: Key) -> bool { self.events.retain(|event| { !matches!( diff --git a/egui_demo_lib/src/easy_mark/easy_mark_editor.rs b/egui_demo_lib/src/easy_mark/easy_mark_editor.rs index bd383ac45d1a..a43b412c7225 100644 --- a/egui_demo_lib/src/easy_mark/easy_mark_editor.rs +++ b/egui_demo_lib/src/easy_mark/easy_mark_editor.rs @@ -127,11 +127,8 @@ fn shortcuts(ui: &Ui, code: &mut dyn TextBuffer, ccursor_range: &mut CCursorRang (Key::U, "_"), // _underline_ ] { if ui.input_mut().consume_key( - key, - egui::Modifiers { - command: true, - ..Default::default() - }, + egui::Modifiers::new().command(true), + key ) { toggle_surrounding(code, ccursor_range, surrounding); any_change = true;