diff --git a/src/bin/main.rs b/src/bin/main.rs index 9577d041388f..dba319f44af3 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -130,11 +130,6 @@ fn make_opts() -> Options { "Format specified line ranges. See README for more detail on the JSON format.", "JSON", ); - opts.optflag( - "", - "verbose-diff", - "Emit a more verbose diff, indicating the end of lines.", - ); opts.optflag("h", "help", "Show this message"); opts.optflag("", "skip-children", "Don't reformat child modules"); opts.optflag( diff --git a/src/config/mod.rs b/src/config/mod.rs index 5f6d9082ce87..ac81ded5f76f 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -144,7 +144,6 @@ create_config! { // Not user-facing verbose: Verbosity, Verbosity::Normal, false, "How much to information to emit to the user"; - verbose_diff: bool, false, false, "Emit verbose diffs"; file_lines: FileLines, FileLines::all(), false, "Lines to format; this is not supported in rustfmt.toml, and can only be specified \ via the --file-lines option"; diff --git a/src/config/options.rs b/src/config/options.rs index e18c88c30273..a11e1f01eaf6 100644 --- a/src/config/options.rs +++ b/src/config/options.rs @@ -330,7 +330,6 @@ pub struct CliOptions { skip_children: Option, quiet: bool, verbose: bool, - verbose_diff: bool, pub(super) config_path: Option, write_mode: Option, color: Option, @@ -347,7 +346,6 @@ impl CliOptions { if options.verbose && options.quiet { return Err(format_err!("Can't use both `--verbose` and `--quiet`")); } - options.verbose_diff = matches.opt_present("verbose-diff"); let unstable_features = matches.opt_present("unstable-features"); let rust_nightly = option_env!("CFG_RELEASE_CHANNEL") @@ -404,7 +402,6 @@ impl CliOptions { } else { config.set().verbose(Verbosity::Normal); } - config.set().verbose_diff(self.verbose_diff); config.set().file_lines(self.file_lines); config.set().unstable_features(self.unstable_features); if let Some(skip_children) = self.skip_children { diff --git a/src/rustfmt_diff.rs b/src/rustfmt_diff.rs index 178ed99f6960..f2acc96a8deb 100644 --- a/src/rustfmt_diff.rs +++ b/src/rustfmt_diff.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use config::{Color, Config}; +use config::{Color, Config, Verbosity}; use diff; use std::collections::VecDeque; use std::io; @@ -154,7 +154,11 @@ where F: Fn(u32) -> String, { let color = config.color(); - let line_terminator = if config.verbose_diff() { "⏎" } else { "" }; + let line_terminator = if config.verbose() == Verbosity::Verbose { + "⏎" + } else { + "" + }; let mut writer = OutputWriter::new(color);