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:
Otavio Salvador 2018-10-23 02:33:25 -03:00
parent fa3cadf62c
commit e9fa99d8b8

View File

@ -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") {