@@ -22,13 +22,17 @@ impl fmt::Display for Info {
22
22
s. push_str (
23
23
& ( "Project: " . color ( color) . bold ( ) . to_string ( ) + & format ! ( "{}\n " , self . project_name) ) ,
24
24
) ;
25
-
25
+
26
26
s. push_str (
27
27
& ( "Language: " . color ( color) . bold ( ) . to_string ( ) + & format ! ( "{}\n " , self . language) ) ,
28
28
) ;
29
-
29
+
30
30
if self . authors . len ( ) > 0 {
31
- let title = if self . authors . len ( ) > 1 { "Authors: " } else { "Author: " } ;
31
+ let title = if self . authors . len ( ) > 1 {
32
+ "Authors: "
33
+ } else {
34
+ "Author: "
35
+ } ;
32
36
33
37
let first = self . authors . first ( ) . unwrap ( ) ;
34
38
s. push_str ( & ( title. color ( color) . bold ( ) . to_string ( ) + & format ! ( "{}\n " , first) ) ) ;
@@ -39,7 +43,7 @@ impl fmt::Display for Info {
39
43
s. push_str ( & ( title. color ( color) . bold ( ) . to_string ( ) + & format ! ( "{}\n " , author) ) ) ;
40
44
}
41
45
}
42
-
46
+
43
47
s. push_str ( & ( "Repo: " . color ( color) . bold ( ) . to_string ( ) + & format ! ( "{}\n " , self . repo) ) ) ;
44
48
s. push_str (
45
49
& ( "Number of lines: " . color ( color) . bold ( ) . to_string ( )
@@ -166,20 +170,20 @@ fn project_languages() -> tokei::Languages {
166
170
167
171
fn is_git_installed ( ) -> bool {
168
172
Command :: new ( "git" )
169
- . arg ( "--version" )
170
- . stdout ( Stdio :: null ( ) )
171
- . status ( )
172
- . is_ok ( )
173
+ . arg ( "--version" )
174
+ . stdout ( Stdio :: null ( ) )
175
+ . status ( )
176
+ . is_ok ( )
173
177
}
174
178
175
179
// Return first n most active commiters as authors within this project.
176
180
fn get_authors ( n : usize ) -> Vec < String > {
177
181
use std:: collections:: HashMap ;
178
182
let output = Command :: new ( "git" )
179
- . arg ( "log" )
180
- . arg ( "--format='%aN'" )
181
- . output ( )
182
- . expect ( "Failed to execute git." ) ;
183
+ . arg ( "log" )
184
+ . arg ( "--format='%aN'" )
185
+ . output ( )
186
+ . expect ( "Failed to execute git." ) ;
183
187
184
188
// create map for storing author name as a key and their commit count as value
185
189
let mut authors = HashMap :: new ( ) ;
@@ -198,9 +202,10 @@ fn get_authors(n: usize) -> Vec<String> {
198
202
199
203
// get only authors without their commit count
200
204
// and string "'" prefix and suffix
201
- let authors: Vec < String > = authors. into_iter ( )
202
- . map ( |( author, _) | author. trim_matches ( '\'' ) . to_string ( ) )
203
- . collect ( ) ;
205
+ let authors: Vec < String > = authors
206
+ . into_iter ( )
207
+ . map ( |( author, _) | author. trim_matches ( '\'' ) . to_string ( ) )
208
+ . collect ( ) ;
204
209
205
210
authors
206
211
}
0 commit comments