Use replace rather than overwrite for cargo fmt

This commit is contained in:
Nick Cameron 2015-12-16 18:07:59 +13:00
parent 33d20479f2
commit ecf12778fb
4 changed files with 5 additions and 4 deletions

View file

@ -69,7 +69,7 @@ fn format_crate(opts: &Options) {
}
fn get_fmt_args() -> Vec<String> {
let mut args = vec!["--write-mode=overwrite".to_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));

View file

@ -189,7 +189,7 @@ impl Sub<usize> for Indent {
#[derive(Copy, Clone)]
pub enum WriteMode {
// Backups the original file and overwrites the orignal.
// Backsup the original file and overwrites the orignal.
Replace,
// Overwrites original file without backup.
Overwrite,