Use replace rather than overwrite for cargo fmt
This commit is contained in:
parent
33d20479f2
commit
ecf12778fb
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
|
||||
name = "rustfmt"
|
||||
version = "0.2.0"
|
||||
version = "0.2.1"
|
||||
authors = ["Nicholas Cameron <ncameron@mozilla.com>", "Marcus Klaas <mail@marcusklaas.nl>", "The Rustfmt contributors"]
|
||||
description = "Tool to find and fix Rust formatting issues"
|
||||
repository = "https://github.com/rust-lang-nursery/rustfmt"
|
||||
|
@ -62,7 +62,8 @@ screen, for example.
|
||||
|
||||
You can run `rustfmt --help` for more information.
|
||||
|
||||
`cargo fmt` uses `--write-mode=overwrite` by default.
|
||||
`cargo fmt` uses `--write-mode=replace` by default.
|
||||
|
||||
|
||||
## Running Rustfmt from your editor
|
||||
|
||||
|
@ -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));
|
||||
|
||||
|
@ -189,7 +189,7 @@ fn sub(self, rhs: usize) -> 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,
|
||||
|
Loading…
Reference in New Issue
Block a user