diff --git a/src/indicators/git.rs b/src/indicators/git.rs index 2425808..b70b094 100644 --- a/src/indicators/git.rs +++ b/src/indicators/git.rs @@ -28,10 +28,10 @@ pub fn info() -> Option<(String, String)> { pub fn repo_name(path: &str) -> String { Path::new(path) - .file_name() - .and_then(|name| name.to_str()) - .unwrap_or("") // Default value if None - .to_string() // Convert &str to String + .file_name() // Extracts the last component of the path. + .and_then(|name| name.to_str()) // Converts the `OsStr` to `&str`. + .unwrap_or("") // Default value(empty string) if None(no valid name) + .to_string() // Converts &str to String } //Git branch indicator diff --git a/src/main.rs b/src/main.rs index 041833c..87be1d1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -46,7 +46,6 @@ fn main() { components.push(user::indicator()); } if indicate_err { - //components.push(error::indicator(cmd_args)); components.push(error::indicator(&cmd_args)); } if show_pwd {