From 9352a0f7cfdd5f5fc102a25d8a93218bc3dbe462 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sat, 13 Jun 2026 00:58:32 +0200 Subject: chore(treewide): Fix some of `clippy`'s error Just a run of `cargo clippy --fix` --- crates/turtle/src/atuin_common/shell.rs | 40 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'crates/turtle/src/atuin_common/shell.rs') diff --git a/crates/turtle/src/atuin_common/shell.rs b/crates/turtle/src/atuin_common/shell.rs index d259b99e..880ff00f 100644 --- a/crates/turtle/src/atuin_common/shell.rs +++ b/crates/turtle/src/atuin_common/shell.rs @@ -14,15 +14,15 @@ pub(crate) enum Shell { impl std::fmt::Display for Shell { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let shell = match self { - Shell::Bash => "bash", - Shell::Fish => "fish", - Shell::Zsh => "zsh", - Shell::Nu => "nu", - Shell::Xonsh => "xonsh", - Shell::Sh => "sh", - Shell::Powershell => "powershell", + Self::Bash => "bash", + Self::Fish => "fish", + Self::Zsh => "zsh", + Self::Nu => "nu", + Self::Xonsh => "xonsh", + Self::Sh => "sh", + Self::Powershell => "powershell", - Shell::Unknown => "unknown", + Self::Unknown => "unknown", }; write!(f, "{shell}") @@ -30,23 +30,23 @@ impl std::fmt::Display for Shell { } impl Shell { - pub(crate) fn from_env() -> Shell { - std::env::var("ATUIN_SHELL").map_or(Shell::Unknown, |shell| { - Shell::from_string(shell.trim().to_lowercase().as_str()) + pub(crate) fn from_env() -> Self { + std::env::var("ATUIN_SHELL").map_or(Self::Unknown, |shell| { + Self::from_string(shell.trim().to_lowercase().as_str()) }) } - pub(crate) fn from_string(name: &str) -> Shell { + pub(crate) fn from_string(name: &str) -> Self { match name { - "bash" => Shell::Bash, - "fish" => Shell::Fish, - "zsh" => Shell::Zsh, - "xonsh" => Shell::Xonsh, - "nu" => Shell::Nu, - "sh" => Shell::Sh, - "powershell" => Shell::Powershell, + "bash" => Self::Bash, + "fish" => Self::Fish, + "zsh" => Self::Zsh, + "xonsh" => Self::Xonsh, + "nu" => Self::Nu, + "sh" => Self::Sh, + "powershell" => Self::Powershell, - _ => Shell::Unknown, + _ => Self::Unknown, } } } -- cgit v1.3.1