Fix after using clippy

master
Benoît Mauduit 2018-05-02 10:24:24 +02:00
parent 5683a7d10c
commit 8e4b2f2597
1 changed files with 9 additions and 15 deletions

View File

@ -24,7 +24,7 @@ struct Args {
}
impl Args {
fn new(matches: ArgMatches) -> Args {
fn new(matches: &ArgMatches) -> Args {
let i = matches.value_of("source").unwrap();
let o = matches.value_of("dest").unwrap();
@ -60,11 +60,7 @@ impl Args {
}
fn check_not_same(&self) -> bool {
if self.input == self.output {
false
} else {
true
}
self.input != self.output
}
fn check_not_parent(&self) -> bool {
@ -129,20 +125,18 @@ fn main() {
.get_matches();
t.fg(term::color::GREEN).unwrap();
let args = Args::new(matches);
let args = Args::new(&matches);
println!("Value for input: {}", args.input);
println!("Value for output: {}", args.output);
println!("Verbosity Level: {}", args.vlevel);
if args.dryrun == true {
if args.dryrun {
println!("dry-run enabled");
} else {
if args.vlevel >= 2 {
t.fg(term::color::RED).unwrap();
println!("dry-run not enabled");
t.reset().unwrap();
}
} else if args.vlevel >= 2 {
t.fg(term::color::RED).unwrap();
println!("dry-run not enabled");
t.reset().unwrap();
}
// Check input & output
@ -180,7 +174,7 @@ fn main() {
&format!("[{}] - {}",
i,
entry.path().display()));
i = i+1;
i += 1;
}
}
}