@@ -54,11 +54,7 @@ impl std::fmt::Display for Info {
54
54
if !self . config . disabled_fields . project {
55
55
let branches_tags_str = self . get_branches_and_tags_field ( ) ;
56
56
57
- let project_str = & self . get_formatted_subtitle_label (
58
- "Project" ,
59
- self . color_set . subtitle ,
60
- self . color_set . colon ,
61
- ) ;
57
+ let project_str = & self . get_formatted_subtitle_label ( "Project" ) ;
62
58
63
59
writeln ! (
64
60
f,
@@ -73,11 +69,7 @@ impl std::fmt::Display for Info {
73
69
writeln ! (
74
70
f,
75
71
"{}{}" ,
76
- & self . get_formatted_subtitle_label(
77
- "HEAD" ,
78
- self . color_set. subtitle,
79
- self . color_set. colon,
80
- ) ,
72
+ & self . get_formatted_subtitle_label( "HEAD" ) ,
81
73
& self . current_commit. to_string( ) . color( self . color_set. info) ,
82
74
) ?;
83
75
}
@@ -86,11 +78,7 @@ impl std::fmt::Display for Info {
86
78
writeln ! (
87
79
f,
88
80
"{}{}" ,
89
- & self . get_formatted_subtitle_label(
90
- "Pending" ,
91
- self . color_set. subtitle,
92
- self . color_set. colon,
93
- ) ,
81
+ & self . get_formatted_subtitle_label( "Pending" ) ,
94
82
& self . pending. color( self . color_set. info) ,
95
83
) ?;
96
84
}
@@ -99,11 +87,7 @@ impl std::fmt::Display for Info {
99
87
writeln ! (
100
88
f,
101
89
"{}{}" ,
102
- & self . get_formatted_subtitle_label(
103
- "Version" ,
104
- self . color_set. subtitle,
105
- self . color_set. colon,
106
- ) ,
90
+ & self . get_formatted_subtitle_label( "Version" ) ,
107
91
& self . version. color( self . color_set. info) ,
108
92
) ?;
109
93
}
@@ -112,11 +96,7 @@ impl std::fmt::Display for Info {
112
96
writeln ! (
113
97
f,
114
98
"{}{}" ,
115
- & self . get_formatted_subtitle_label(
116
- "Created" ,
117
- self . color_set. subtitle,
118
- self . color_set. colon,
119
- ) ,
99
+ & self . get_formatted_subtitle_label( "Created" ) ,
120
100
& self . creation_date. color( self . color_set. info) ,
121
101
) ?;
122
102
}
@@ -133,11 +113,7 @@ impl std::fmt::Display for Info {
133
113
writeln ! (
134
114
f,
135
115
"{}{}" ,
136
- & self . get_formatted_subtitle_label(
137
- title,
138
- self . color_set. subtitle,
139
- self . color_set. colon,
140
- ) ,
116
+ & self . get_formatted_subtitle_label( title) ,
141
117
languages_str. color( self . color_set. info)
142
118
) ?;
143
119
}
@@ -154,11 +130,7 @@ impl std::fmt::Display for Info {
154
130
write ! (
155
131
f,
156
132
"{}{}" ,
157
- & self . get_formatted_subtitle_label(
158
- title,
159
- self . color_set. subtitle,
160
- self . color_set. colon,
161
- ) ,
133
+ & self . get_formatted_subtitle_label( title) ,
162
134
author_str. color( self . color_set. info) ,
163
135
) ?;
164
136
}
@@ -167,11 +139,7 @@ impl std::fmt::Display for Info {
167
139
writeln ! (
168
140
f,
169
141
"{}{}" ,
170
- & self . get_formatted_subtitle_label(
171
- "Last change" ,
172
- self . color_set. subtitle,
173
- self . color_set. colon,
174
- ) ,
142
+ & self . get_formatted_subtitle_label( "Last change" ) ,
175
143
& self . last_change. color( self . color_set. info) ,
176
144
) ?;
177
145
}
@@ -180,11 +148,7 @@ impl std::fmt::Display for Info {
180
148
writeln ! (
181
149
f,
182
150
"{}{}" ,
183
- & self . get_formatted_subtitle_label(
184
- "Repo" ,
185
- self . color_set. subtitle,
186
- self . color_set. colon,
187
- ) ,
151
+ & self . get_formatted_subtitle_label( "Repo" ) ,
188
152
& self . repo_url. color( self . color_set. info) ,
189
153
) ?;
190
154
}
@@ -193,11 +157,7 @@ impl std::fmt::Display for Info {
193
157
writeln ! (
194
158
f,
195
159
"{}{}" ,
196
- & self . get_formatted_subtitle_label(
197
- "Commits" ,
198
- self . color_set. subtitle,
199
- self . color_set. colon,
200
- ) ,
160
+ & self . get_formatted_subtitle_label( "Commits" ) ,
201
161
& self . commits. color( self . color_set. info) ,
202
162
) ?;
203
163
}
@@ -206,11 +166,7 @@ impl std::fmt::Display for Info {
206
166
writeln ! (
207
167
f,
208
168
"{} {}" ,
209
- & self . get_formatted_subtitle_label(
210
- "Lines of code" ,
211
- self . color_set. subtitle,
212
- self . color_set. colon,
213
- ) ,
169
+ & self . get_formatted_subtitle_label( "Lines of code" ) ,
214
170
& self . number_of_lines. to_string( ) . color( self . color_set. info) ,
215
171
) ?;
216
172
}
@@ -219,11 +175,7 @@ impl std::fmt::Display for Info {
219
175
writeln ! (
220
176
f,
221
177
"{}{}" ,
222
- & self . get_formatted_subtitle_label(
223
- "Size" ,
224
- self . color_set. subtitle,
225
- self . color_set. colon,
226
- ) ,
178
+ & self . get_formatted_subtitle_label( "Size" ) ,
227
179
& self . repo_size. color( self . color_set. info) ,
228
180
) ?;
229
181
}
@@ -232,11 +184,7 @@ impl std::fmt::Display for Info {
232
184
writeln ! (
233
185
f,
234
186
"{}{}" ,
235
- & self . get_formatted_subtitle_label(
236
- "License" ,
237
- self . color_set. subtitle,
238
- self . color_set. colon,
239
- ) ,
187
+ & self . get_formatted_subtitle_label( "License" ) ,
240
188
& self . license. color( self . color_set. info) ,
241
189
) ?;
242
190
}
@@ -698,13 +646,12 @@ impl Info {
698
646
Some ( color)
699
647
}
700
648
701
- fn get_formatted_subtitle_label (
702
- & self ,
703
- label : & str ,
704
- color : Color ,
705
- colon_clr : Color ,
706
- ) -> ColoredString {
707
- let formatted_label = format ! ( "{}{} " , label. color( color) , ":" . color( colon_clr) ) ;
649
+ fn get_formatted_subtitle_label ( & self , label : & str ) -> ColoredString {
650
+ let formatted_label = format ! (
651
+ "{}{} " ,
652
+ label. color( self . color_set. subtitle) ,
653
+ ":" . color( self . color_set. colon)
654
+ ) ;
708
655
self . bold ( & formatted_label)
709
656
}
710
657
0 commit comments