Skip to content

Commit

Permalink
deprecate --backup option (#3902)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebcartwright authored and topecongiro committed Nov 12, 2019
1 parent fb5fea6 commit 7ecd467
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 51 deletions.
4 changes: 0 additions & 4 deletions Configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2442,10 +2442,6 @@ Break comments to fit on the line

Internal option

## `make_backup`

Internal option, use `--backup`

## `print_misformatted_file_names`

Internal option, use `-l` or `--files-with-diff`
9 changes: 0 additions & 9 deletions src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ fn make_opts() -> Options {
"[files|stdout]"
};
opts.optopt("", "emit", "What data to emit and how", emit_opts);
opts.optflag("", "backup", "Backup any modified files.");
opts.optopt(
"",
"config-path",
Expand Down Expand Up @@ -506,7 +505,6 @@ struct GetOptsOptions {
config_path: Option<PathBuf>,
inline_config: HashMap<String, String>,
emit_mode: Option<EmitMode>,
backup: bool,
check: bool,
edition: Option<Edition>,
color: Option<Color>,
Expand Down Expand Up @@ -608,10 +606,6 @@ impl GetOptsOptions {
options.edition = Some(edition_from_edition_str(edition_str)?);
}

if matches.opt_present("backup") {
options.backup = true;
}

if matches.opt_present("files-with-diff") {
options.print_misformatted_file_names = true;
}
Expand Down Expand Up @@ -675,9 +669,6 @@ impl CliOptions for GetOptsOptions {
} else if let Some(emit_mode) = self.emit_mode {
config.set().emit_mode(emit_mode);
}
if self.backup {
config.set().make_backup(true);
}
if let Some(color) = self.color {
config.set().color(color);
}
Expand Down
2 changes: 0 additions & 2 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ create_config! {
"'small' heuristic values";
emit_mode: EmitMode, EmitMode::Files, false,
"What emit Mode to use when none is supplied";
make_backup: bool, false, false, "Backup changed files";
print_misformatted_file_names: bool, false, true,
"Prints the names of mismatched files that were formatted. Prints the names of \
files that would be formated when used with `--check` mode. ";
Expand Down Expand Up @@ -552,7 +551,6 @@ report_todo = "Never"
report_fixme = "Never"
ignore = []
emit_mode = "Files"
make_backup = false
"#,
env!("CARGO_PKG_VERSION")
);
Expand Down
2 changes: 0 additions & 2 deletions src/emitter.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pub(crate) use self::checkstyle::*;
pub(crate) use self::diff::*;
pub(crate) use self::files::*;
pub(crate) use self::files_with_backup::*;
pub(crate) use self::json::*;
pub(crate) use self::modified_lines::*;
pub(crate) use self::stdout::*;
Expand All @@ -12,7 +11,6 @@ use std::path::Path;
mod checkstyle;
mod diff;
mod files;
mod files_with_backup;
mod json;
mod modified_lines;
mod stdout;
Expand Down
31 changes: 0 additions & 31 deletions src/emitter/files_with_backup.rs

This file was deleted.

3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,6 @@ impl<'b, T: Write + 'b> Session<'b, T> {

pub(crate) fn create_emitter<'a>(config: &Config) -> Box<dyn Emitter + 'a> {
match config.emit_mode() {
EmitMode::Files if config.make_backup() => {
Box::new(emitter::FilesWithBackupEmitter::default())
}
EmitMode::Files => Box::new(emitter::FilesEmitter::new(
config.print_misformatted_file_names(),
)),
Expand Down

0 comments on commit 7ecd467

Please sign in to comment.