summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatan Kushner <hello@matchai.dev>2020-02-03 17:01:50 -0500
committerMatan Kushner <hello@matchai.dev>2020-02-03 17:01:50 -0500
commit0d1578bbe10620186bc7eaf99fb2b33214d633af (patch)
tree0a1fad004e903f3bfffc6a542f175834f3f7b051 /src
parentcb6819c7d8944651d5a7b15acf43608cfca2ee57 (diff)
fix: move get_shell method into Context
Diffstat (limited to 'src')
-rw-r--r--src/context.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/context.rs b/src/context.rs
index 7a35dd404..6faa78844 100644
--- a/src/context.rs
+++ b/src/context.rs
@@ -150,6 +150,18 @@ impl<'a> Context<'a> {
DirContents::from_path_with_timeout(&self.current_dir, timeout)
})
}
+
+ fn get_shell() -> Shell {
+ let shell = std::env::var("STARSHIP_SHELL").unwrap_or_default();
+ match shell.as_str() {
+ "bash" => Shell::Bash,
+ "fish" => Shell::Fish,
+ "ion" => Shell::Ion,
+ "powershell" => Shell::PowerShell,
+ "zsh" => Shell::Zsh,
+ _ => Shell::Unknown,
+ }
+ }
}
#[derive(Debug)]
@@ -240,18 +252,6 @@ impl DirContents {
pub fn has_any_extension(&self, exts: &[&str]) -> bool {
exts.iter().any(|ext| self.has_extension(ext))
}
-
- fn get_shell() -> Shell {
- let shell = std::env::var("STARSHIP_SHELL").unwrap_or_default();
- match shell.as_str() {
- "bash" => Shell::Bash,
- "fish" => Shell::Fish,
- "ion" => Shell::Ion,
- "powershell" => Shell::PowerShell,
- "zsh" => Shell::Zsh,
- _ => Shell::Unknown,
- }
- }
}
pub struct Repo {