diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-06-13 01:36:41 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-06-13 01:36:41 +0200 |
| commit | 47b76481e51451827530714512b30882d85e3a9a (patch) | |
| tree | 3e64edfa304e11e4dff506683dd0a7ea7929123e /crates/turtle/src/command/client | |
| parent | chore(treewide): Fix some of `clippy`'s error (diff) | |
| download | atuin-47b76481e51451827530714512b30882d85e3a9a.zip | |
chore(treewide): Also fix all `clippy` warnings
Diffstat (limited to 'crates/turtle/src/command/client')
| -rw-r--r-- | crates/turtle/src/command/client/history.rs | 2 | ||||
| -rw-r--r-- | crates/turtle/src/command/client/init.rs | 7 | ||||
| -rw-r--r-- | crates/turtle/src/command/client/search.rs | 8 | ||||
| -rw-r--r-- | crates/turtle/src/command/client/search/duration.rs | 2 | ||||
| -rw-r--r-- | crates/turtle/src/command/client/store/rekey.rs | 2 |
5 files changed, 9 insertions, 12 deletions
diff --git a/crates/turtle/src/command/client/history.rs b/crates/turtle/src/command/client/history.rs index e574a2e9..fcc622d7 100644 --- a/crates/turtle/src/command/client/history.rs +++ b/crates/turtle/src/command/client/history.rs @@ -202,7 +202,7 @@ pub(crate) fn print_list( ListMode::CmdOnly => std::iter::once(ParseSegment::Key("command")).collect(), }; - #[allow(trivial_casts)] + #[expect(trivial_casts)] let iterator = if reverse { Box::new(h.iter().rev()) as Box<dyn Iterator<Item = &History>> } else { diff --git a/crates/turtle/src/command/client/init.rs b/crates/turtle/src/command/client/init.rs index 0cdcd425..0db9b143 100644 --- a/crates/turtle/src/command/client/init.rs +++ b/crates/turtle/src/command/client/init.rs @@ -26,18 +26,23 @@ pub(crate) struct Cmd { #[derive(Clone, Copy, ValueEnum, Debug)] #[value(rename_all = "lower")] -#[expect(clippy::enum_variant_names, clippy::doc_markdown)] +#[expect(clippy::enum_variant_names)] pub(crate) enum Shell { /// Zsh setup Zsh, + /// Bash setup Bash, + /// Fish setup Fish, + /// Nu setup Nu, + /// Xonsh setup Xonsh, + /// PowerShell setup PowerShell, } diff --git a/crates/turtle/src/command/client/search.rs b/crates/turtle/src/command/client/search.rs index 5c51caea..359864cb 100644 --- a/crates/turtle/src/command/client/search.rs +++ b/crates/turtle/src/command/client/search.rs @@ -163,12 +163,7 @@ impl Cmd { let query = self.query.unwrap_or_else(|| { std::env::var("ATUIN_QUERY").map_or_else( |_| vec![], - |query| { - query - .split(' ') - .map(ToString::to_string) - .collect() - }, + |query| query.split(' ').map(ToString::to_string).collect(), ) }); @@ -302,7 +297,6 @@ impl Cmd { // This is supposed to more-or-less mirror the command line version, so ofc // it is going to have a lot of args -#[expect(clippy::too_many_arguments, clippy::cast_possible_truncation)] async fn run_non_interactive( settings: &Settings, filter_options: OptFilters, diff --git a/crates/turtle/src/command/client/search/duration.rs b/crates/turtle/src/command/client/search/duration.rs index bc8dbed3..0d70353a 100644 --- a/crates/turtle/src/command/client/search/duration.rs +++ b/crates/turtle/src/command/client/search/duration.rs @@ -1,7 +1,6 @@ use core::fmt; use std::{ops::ControlFlow, time::Duration}; -#[expect(clippy::module_name_repetitions)] pub(crate) fn format_duration_into(dur: Duration, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn item(unit: &'static str, value: u64) -> ControlFlow<(&'static str, u64)> { if value > 0 { @@ -53,7 +52,6 @@ pub(crate) fn format_duration_into(dur: Duration, f: &mut fmt::Formatter<'_>) -> } } -#[expect(clippy::module_name_repetitions)] pub(crate) fn format_duration(f: Duration) -> String { struct F(Duration); impl fmt::Display for F { diff --git a/crates/turtle/src/command/client/store/rekey.rs b/crates/turtle/src/command/client/store/rekey.rs index e89d83c2..2b379327 100644 --- a/crates/turtle/src/command/client/store/rekey.rs +++ b/crates/turtle/src/command/client/store/rekey.rs @@ -27,7 +27,7 @@ impl Rekey { }; let current_key: [u8; 32] = load_key(settings)?.into(); - let new_key: [u8; 32] = decode_key(key.clone())?.into(); + let new_key: [u8; 32] = decode_key(&key)?.into(); store.re_encrypt(¤t_key, &new_key).await?; |
