Skip to content

Commit 1869888

Browse files
committed
Remove --verbose-diff
Use `--verbose` instead cc #1976
1 parent 55ac062 commit 1869888

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

src/bin/main.rs

-5
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,6 @@ fn make_opts() -> Options {
130130
"Format specified line ranges. See README for more detail on the JSON format.",
131131
"JSON",
132132
);
133-
opts.optflag(
134-
"",
135-
"verbose-diff",
136-
"Emit a more verbose diff, indicating the end of lines.",
137-
);
138133
opts.optflag("h", "help", "Show this message");
139134
opts.optflag("", "skip-children", "Don't reformat child modules");
140135
opts.optflag(

src/config/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ create_config! {
144144

145145
// Not user-facing
146146
verbose: Verbosity, Verbosity::Normal, false, "How much to information to emit to the user";
147-
verbose_diff: bool, false, false, "Emit verbose diffs";
148147
file_lines: FileLines, FileLines::all(), false,
149148
"Lines to format; this is not supported in rustfmt.toml, and can only be specified \
150149
via the --file-lines option";

src/config/options.rs

-3
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ pub struct CliOptions {
330330
skip_children: Option<bool>,
331331
quiet: bool,
332332
verbose: bool,
333-
verbose_diff: bool,
334333
pub(super) config_path: Option<PathBuf>,
335334
write_mode: Option<WriteMode>,
336335
color: Option<Color>,
@@ -347,7 +346,6 @@ impl CliOptions {
347346
if options.verbose && options.quiet {
348347
return Err(format_err!("Can't use both `--verbose` and `--quiet`"));
349348
}
350-
options.verbose_diff = matches.opt_present("verbose-diff");
351349

352350
let unstable_features = matches.opt_present("unstable-features");
353351
let rust_nightly = option_env!("CFG_RELEASE_CHANNEL")
@@ -404,7 +402,6 @@ impl CliOptions {
404402
} else {
405403
config.set().verbose(Verbosity::Normal);
406404
}
407-
config.set().verbose_diff(self.verbose_diff);
408405
config.set().file_lines(self.file_lines);
409406
config.set().unstable_features(self.unstable_features);
410407
if let Some(skip_children) = self.skip_children {

src/rustfmt_diff.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use config::{Color, Config};
11+
use config::{Color, Config, Verbosity};
1212
use diff;
1313
use std::collections::VecDeque;
1414
use std::io;
@@ -154,7 +154,11 @@ where
154154
F: Fn(u32) -> String,
155155
{
156156
let color = config.color();
157-
let line_terminator = if config.verbose_diff() { "⏎" } else { "" };
157+
let line_terminator = if config.verbose() == Verbosity::Verbose {
158+
"⏎"
159+
} else {
160+
""
161+
};
158162

159163
let mut writer = OutputWriter::new(color);
160164

0 commit comments

Comments
 (0)