Drop extra fmt command line argument provided by cargo

This commit is contained in:
Ivan Veselov 2019-05-20 13:17:32 +01:00
parent ed073a9b7c
commit 32fbe75a4c

View file

@ -61,7 +61,9 @@ const SUCCESS: i32 = 0;
const FAILURE: i32 = 1;
fn execute() -> i32 {
let opts = Opts::from_args();
// Drop extra `fmt` argument provided by `cargo`.
let args = env::args().filter(|x| x != "fmt");
let opts = Opts::from_iter(args);
let verbosity = match (opts.verbose, opts.quiet) {
(false, false) => Verbosity::Normal,