Skip to content

Commit 39eb453

Browse files
committed
Format files and fix Clippy lints
1 parent a55ab94 commit 39eb453

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/main.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use git2::{Commit, Repository};
88
use std::cmp::PartialEq;
99
use std::collections::HashMap;
1010
use std::env;
11-
use std::path::PathBuf;
1211
use std::error::Error;
12+
use std::path::PathBuf;
1313
use structopt::clap::AppSettings;
1414
use structopt::StructOpt;
1515

@@ -22,7 +22,11 @@ static CURSES: &str = include_str!("words.txt");
2222
raw(global_settings = "&[AppSettings::ColoredHelp]")
2323
)]
2424
struct 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 {
6569
fn 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();

0 commit comments

Comments
 (0)