We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1fb086f commit daa59b4Copy full SHA for daa59b4
src/info.rs
@@ -42,10 +42,13 @@ impl std::fmt::Display for Info {
42
None => Color::White,
43
};
44
if !self.disable_fields.git_info{
45
- let mut git_info = String::from(&self.git_username);
+ let username = if self.git_username == "" {
46
+ String::from("")
47
+ }else{
48
+ String::from(format!("{}:",self.git_username))
49
+ };
50
- git_info.push(':');
- git_info.push_str(&self.git_version);
51
+ let git_info = format!("{}{}", username, self.git_version);
52
write_buf(&mut buf, "", &git_info, color)?;
53
54
let separator = "-".repeat(git_info.len());
0 commit comments