File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ use git2::{Commit, Repository};
88use std:: cmp:: PartialEq ;
99use std:: collections:: HashMap ;
1010use std:: env;
11- use std:: path:: PathBuf ;
1211use std:: error:: Error ;
12+ use std:: path:: PathBuf ;
1313use structopt:: clap:: AppSettings ;
1414use structopt:: StructOpt ;
1515
@@ -22,7 +22,11 @@ static CURSES: &str = include_str!("words.txt");
2222 raw( global_settings = "&[AppSettings::ColoredHelp]" )
2323) ]
2424struct Cli {
25- #[ structopt( name = "directory" , help = "Directory to parse commits" , parse( from_os_str) ) ]
25+ #[ structopt(
26+ name = "directory" ,
27+ help = "Directory to parse commits" ,
28+ parse( from_os_str)
29+ ) ]
2630 directory : Option < PathBuf > ,
2731}
2832
@@ -65,12 +69,11 @@ impl Author {
6569fn main ( ) -> Result < ( ) , Box < Error > > {
6670 let opt = Cli :: from_args ( ) ;
6771 let curses: Vec < & str > = CURSES . lines ( ) . collect ( ) ;
68- let path;
69- if opt. directory . is_none ( ) {
70- path = env:: current_dir ( ) ?;
72+ let path = if opt. directory . is_none ( ) {
73+ env:: current_dir ( ) ?
7174 } else {
72- path = PathBuf :: from ( opt. directory . unwrap ( ) ) ;
73- }
75+ opt. directory . unwrap ( )
76+ } ;
7477 let repo = Repository :: open ( path) ?;
7578 let mut revwalk = repo. revwalk ( ) ?;
7679 let mut commits: Vec < Commit > = Vec :: new ( ) ;
You can’t perform that action at this time.
0 commit comments