mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-02 18:12:51 +00:00
rustfmt: avoid duplicating the error handling for --emit
There is no need to produce the error message again as it is already produced by the helper method that does the emit mode validation. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
This commit is contained in:
parent
fa3cadf62c
commit
e9fa99d8b8
@ -496,11 +496,8 @@ impl GetOptsOptions {
|
||||
if options.check {
|
||||
return Err(format_err!("Invalid to use `--emit` and `--check`"));
|
||||
}
|
||||
if let Ok(emit_mode) = emit_mode_from_emit_str(emit_str) {
|
||||
options.emit_mode = emit_mode;
|
||||
} else {
|
||||
return Err(format_err!("Invalid value for `--emit`"));
|
||||
}
|
||||
|
||||
options.emit_mode = emit_mode_from_emit_str(emit_str)?;
|
||||
}
|
||||
|
||||
if matches.opt_present("backup") {
|
||||
|
Loading…
Reference in New Issue
Block a user