Add `Copy` derive to `PromptEvent`

imgbot
Wojciech Kępka 4 years ago committed by Blaž Hrastnik
parent b500a2a138
commit d8b5d1181f

@ -1024,12 +1024,12 @@ mod cmd {
} }
fn write_quit(editor: &mut Editor, args: &[&str], event: PromptEvent) { fn write_quit(editor: &mut Editor, args: &[&str], event: PromptEvent) {
write(editor, args, event.clone()); write(editor, args, event);
quit(editor, &[], event); quit(editor, &[], event);
} }
fn force_write_quit(editor: &mut Editor, args: &[&str], event: PromptEvent) { fn force_write_quit(editor: &mut Editor, args: &[&str], event: PromptEvent) {
write(editor, args, event.clone()); write(editor, args, event);
force_quit(editor, &[], event); force_quit(editor, &[], event);
} }

@ -18,7 +18,7 @@ pub struct Prompt {
pub doc_fn: Box<dyn Fn(&str) -> Option<&'static str>>, pub doc_fn: Box<dyn Fn(&str) -> Option<&'static str>>,
} }
#[derive(Clone, PartialEq)] #[derive(Clone, Copy, PartialEq)]
pub enum PromptEvent { pub enum PromptEvent {
/// The prompt input has been updated. /// The prompt input has been updated.
Update, Update,

Loading…
Cancel
Save