From 69ea3213a56334a31407c4e2c257b1f8e235658f Mon Sep 17 00:00:00 2001 From: candifloss Date: Sat, 17 Aug 2024 16:48:19 +0530 Subject: [PATCH] fixed errors --- src/main.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 76912af..519e450 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,7 +25,7 @@ fn get_shell_char (shell: String) -> String { } fn get_git_char (git_branch: String) -> ColoredString { - match get_git_char.as_str() { + match git_branch.as_str() { "main" => " 󰊢 ".truecolor(178,98,44), "master" => " 󰊢 ".truecolor(196,132,29), _ => " 󰊢 ".truecolor(82,82,82), @@ -104,11 +104,8 @@ fn main() -> std::io::Result<()> { .split(" ").collect::>()[2] .truecolor(82,82,82); - git_char = match git_branch.to_string().as_str() { - "main" => " 󰊢 ".truecolor(178,98,44), - "master" => " 󰊢 ".truecolor(196,132,29), - _ => " 󰊢 ".truecolor(82,82,82), - }; + git_char = get_git_char(git_branch.to_string()); + let git_repo_root_cmd = Command::new("git") .arg("rev-parse") .arg("--show-toplevel")