Apply clippy lints (#551)

MSRV >= 1.62
This commit is contained in:
Stefan Holderbach 2023-03-13 22:52:36 +01:00 committed by GitHub
parent ac1d9549a3
commit 92cb330925
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 15 deletions

View File

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

View File

@ -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::<FileBackedHistory>::default();
(
hist,
HistoryCursor::new(HistoryNavigationQuery::Normal(LineBuffer::default())),

View File

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