Skip to content

Commit 7ecd467

Browse files
calebcartwrighttopecongiro
authored andcommitted
deprecate --backup option (#3902)
1 parent fb5fea6 commit 7ecd467

File tree

6 files changed

+0
-51
lines changed

6 files changed

+0
-51
lines changed

Configurations.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2442,10 +2442,6 @@ Break comments to fit on the line
24422442

24432443
Internal option
24442444

2445-
## `make_backup`
2446-
2447-
Internal option, use `--backup`
2448-
24492445
## `print_misformatted_file_names`
24502446

24512447
Internal option, use `-l` or `--files-with-diff`

src/bin/main.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ fn make_opts() -> Options {
110110
"[files|stdout]"
111111
};
112112
opts.optopt("", "emit", "What data to emit and how", emit_opts);
113-
opts.optflag("", "backup", "Backup any modified files.");
114113
opts.optopt(
115114
"",
116115
"config-path",
@@ -506,7 +505,6 @@ struct GetOptsOptions {
506505
config_path: Option<PathBuf>,
507506
inline_config: HashMap<String, String>,
508507
emit_mode: Option<EmitMode>,
509-
backup: bool,
510508
check: bool,
511509
edition: Option<Edition>,
512510
color: Option<Color>,
@@ -608,10 +606,6 @@ impl GetOptsOptions {
608606
options.edition = Some(edition_from_edition_str(edition_str)?);
609607
}
610608

611-
if matches.opt_present("backup") {
612-
options.backup = true;
613-
}
614-
615609
if matches.opt_present("files-with-diff") {
616610
options.print_misformatted_file_names = true;
617611
}
@@ -675,9 +669,6 @@ impl CliOptions for GetOptsOptions {
675669
} else if let Some(emit_mode) = self.emit_mode {
676670
config.set().emit_mode(emit_mode);
677671
}
678-
if self.backup {
679-
config.set().make_backup(true);
680-
}
681672
if let Some(color) = self.color {
682673
config.set().color(color);
683674
}

src/config/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ create_config! {
151151
"'small' heuristic values";
152152
emit_mode: EmitMode, EmitMode::Files, false,
153153
"What emit Mode to use when none is supplied";
154-
make_backup: bool, false, false, "Backup changed files";
155154
print_misformatted_file_names: bool, false, true,
156155
"Prints the names of mismatched files that were formatted. Prints the names of \
157156
files that would be formated when used with `--check` mode. ";
@@ -552,7 +551,6 @@ report_todo = "Never"
552551
report_fixme = "Never"
553552
ignore = []
554553
emit_mode = "Files"
555-
make_backup = false
556554
"#,
557555
env!("CARGO_PKG_VERSION")
558556
);

src/emitter.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
pub(crate) use self::checkstyle::*;
22
pub(crate) use self::diff::*;
33
pub(crate) use self::files::*;
4-
pub(crate) use self::files_with_backup::*;
54
pub(crate) use self::json::*;
65
pub(crate) use self::modified_lines::*;
76
pub(crate) use self::stdout::*;
@@ -12,7 +11,6 @@ use std::path::Path;
1211
mod checkstyle;
1312
mod diff;
1413
mod files;
15-
mod files_with_backup;
1614
mod json;
1715
mod modified_lines;
1816
mod stdout;

src/emitter/files_with_backup.rs

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,9 +476,6 @@ impl<'b, T: Write + 'b> Session<'b, T> {
476476

477477
pub(crate) fn create_emitter<'a>(config: &Config) -> Box<dyn Emitter + 'a> {
478478
match config.emit_mode() {
479-
EmitMode::Files if config.make_backup() => {
480-
Box::new(emitter::FilesWithBackupEmitter::default())
481-
}
482479
EmitMode::Files => Box::new(emitter::FilesEmitter::new(
483480
config.print_misformatted_file_names(),
484481
)),

0 commit comments

Comments
 (0)