aboutsummaryrefslogtreecommitdiffstats
path: root/crates/turtle/src/atuin_common/shell.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/turtle/src/atuin_common/shell.rs')
-rw-r--r--crates/turtle/src/atuin_common/shell.rs40
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,
}
}
}