Remove --write-mode=replace from cargo-fmt

Since replace is the default rustfmt write mode, there's no need to
call rustfmt with `--write-mode=replace`. As a bonus, it is now also
possible to override the write-mode.
This commit is contained in:
Jan Likar 2015-12-17 17:17:43 +01:00
parent ecf12778fb
commit c578ad8df5

View File

@ -69,11 +69,8 @@ fn format_crate(opts: &Options) {
}
fn get_fmt_args() -> Vec<String> {
let mut args = vec!["--write-mode=replace".to_string()];
// All arguments after -- are passed to rustfmt
args.extend(env::args().skip_while(|a| a != "--").skip(1));
args
env::args().skip_while(|a| a != "--").skip(1).collect()
}
#[derive(Debug)]