diff --git a/src/core_editor/clip_buffer.rs b/src/core_editor/clip_buffer.rs index 4678c08..0bd9272 100644 --- a/src/core_editor/clip_buffer.rs +++ b/src/core_editor/clip_buffer.rs @@ -16,20 +16,15 @@ pub trait Clipboard: Send { } /// Determines how the content in the clipboard should be inserted -#[derive(Copy, Clone, Debug)] +#[derive(Copy, Clone, Debug, Default)] pub enum ClipboardMode { /// As direct content at the current cursor position + #[default] Normal, /// As new lines below or above Lines, } -impl Default for ClipboardMode { - fn default() -> Self { - ClipboardMode::Normal - } -} - /// Simple buffer that provides a clipboard only usable within the application/library. #[derive(Default)] pub struct LocalClipboard { diff --git a/src/history/cursor.rs b/src/history/cursor.rs index 48a1bab..0f1ca61 100644 --- a/src/history/cursor.rs +++ b/src/history/cursor.rs @@ -109,7 +109,7 @@ mod tests { #[cfg(any(feature = "sqlite", feature = "sqlite-dynlib"))] let hist = Box::new(SqliteBackedHistory::in_memory().unwrap()); #[cfg(not(any(feature = "sqlite", feature = "sqlite-dynlib")))] - let hist = Box::new(FileBackedHistory::default()); + let hist = Box::::default(); ( hist, HistoryCursor::new(HistoryNavigationQuery::Normal(LineBuffer::default())), diff --git a/src/prompt/base.rs b/src/prompt/base.rs index 144435e..f5f4a84 100644 --- a/src/prompt/base.rs +++ b/src/prompt/base.rs @@ -59,21 +59,16 @@ pub enum PromptEditMode { } /// The vi-specific modes that the prompt can be in -#[derive(Serialize, Deserialize, Clone, Debug, EnumIter)] +#[derive(Serialize, Deserialize, Clone, Debug, EnumIter, Default)] pub enum PromptViMode { /// The default mode + #[default] Normal, /// Insertion mode Insert, } -impl Default for PromptViMode { - fn default() -> Self { - PromptViMode::Normal - } -} - impl Display for PromptEditMode { fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { match self {