File tree 1 file changed +8
-10
lines changed
1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -43,17 +43,15 @@ impl std::fmt::Display for Info {
43
43
None => Color :: White ,
44
44
} ;
45
45
if !self . disable_fields . git_info {
46
- let username = if self . git_username == "" {
47
- String :: from ( "" )
48
- } else {
49
- format ! ( "{}:" , self . git_username)
50
- } ;
51
-
52
- let git_info = format ! ( "{}{}" , username, self . git_version) ;
53
- write_buf ( & mut buf, "" , & git_info, color) ?;
54
-
46
+ let git_info;
47
+ if self . git_username != "" {
48
+ git_info = format ! ( "{} : {}" , self . git_username, self . git_version) ;
49
+ } else {
50
+ git_info = self . git_version . clone ( ) ;
51
+ }
52
+ write_buf ( & mut buf, & self . get_formatted_info_label ( & git_info, color) , "" ) ?;
55
53
let separator = "-" . repeat ( git_info. len ( ) ) ;
56
- write_buf ( & mut buf, "" , & separator , color ) ?;
54
+ write_buf ( & mut buf, & self . get_formatted_info_label ( "" , color ) , & separator ) ?;
57
55
}
58
56
if !self . disable_fields . project {
59
57
write_buf ( & mut buf, & self . get_formatted_info_label ( "Project: " , color) , & self . project_name ) ?;
You can’t perform that action at this time.
0 commit comments