Add Copy derive to PromptEvent

This commit is contained in:
Wojciech Kępka 2021-06-13 11:00:13 +02:00 committed by Blaž Hrastnik
parent b500a2a138
commit d8b5d1181f
2 changed files with 3 additions and 3 deletions

View File

@ -1024,12 +1024,12 @@ fn later(editor: &mut Editor, args: &[&str], event: PromptEvent) {
} }
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);
} }

View File

@ -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,