Fix after using clippy
parent
5683a7d10c
commit
8e4b2f2597
24
src/main.rs
24
src/main.rs
|
@ -24,7 +24,7 @@ struct Args {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Args {
|
impl Args {
|
||||||
fn new(matches: ArgMatches) -> Args {
|
fn new(matches: &ArgMatches) -> Args {
|
||||||
let i = matches.value_of("source").unwrap();
|
let i = matches.value_of("source").unwrap();
|
||||||
let o = matches.value_of("dest").unwrap();
|
let o = matches.value_of("dest").unwrap();
|
||||||
|
|
||||||
|
@ -60,11 +60,7 @@ impl Args {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_not_same(&self) -> bool {
|
fn check_not_same(&self) -> bool {
|
||||||
if self.input == self.output {
|
self.input != self.output
|
||||||
false
|
|
||||||
} else {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_not_parent(&self) -> bool {
|
fn check_not_parent(&self) -> bool {
|
||||||
|
@ -129,20 +125,18 @@ fn main() {
|
||||||
.get_matches();
|
.get_matches();
|
||||||
|
|
||||||
t.fg(term::color::GREEN).unwrap();
|
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 input: {}", args.input);
|
||||||
println!("Value for output: {}", args.output);
|
println!("Value for output: {}", args.output);
|
||||||
println!("Verbosity Level: {}", args.vlevel);
|
println!("Verbosity Level: {}", args.vlevel);
|
||||||
|
|
||||||
if args.dryrun == true {
|
if args.dryrun {
|
||||||
println!("dry-run enabled");
|
println!("dry-run enabled");
|
||||||
} else {
|
} else if args.vlevel >= 2 {
|
||||||
if args.vlevel >= 2 {
|
t.fg(term::color::RED).unwrap();
|
||||||
t.fg(term::color::RED).unwrap();
|
println!("dry-run not enabled");
|
||||||
println!("dry-run not enabled");
|
t.reset().unwrap();
|
||||||
t.reset().unwrap();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check input & output
|
// Check input & output
|
||||||
|
@ -180,7 +174,7 @@ fn main() {
|
||||||
&format!("[{}] - {}",
|
&format!("[{}] - {}",
|
||||||
i,
|
i,
|
||||||
entry.path().display()));
|
entry.path().display()));
|
||||||
i = i+1;
|
i += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue