diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-06-13 00:58:32 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-06-13 00:58:32 +0200 |
| commit | 9352a0f7cfdd5f5fc102a25d8a93218bc3dbe462 (patch) | |
| tree | b998430c307c10defb79d91abe5d30471c5c4f12 /crates/turtle/src/atuin_common/shell.rs | |
| parent | chore(treewide): Remove `cargo` warnings to 0 (diff) | |
| download | atuin-9352a0f7cfdd5f5fc102a25d8a93218bc3dbe462.zip | |
chore(treewide): Fix some of `clippy`'s error
Just a run of `cargo clippy --fix`
Diffstat (limited to 'crates/turtle/src/atuin_common/shell.rs')
| -rw-r--r-- | crates/turtle/src/atuin_common/shell.rs | 40 |
1 files changed, 20 insertions, 20 deletions
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, } } } |
