diff options
| author | Corey Farwell <coreyf@rwell.org> | 2016-03-20 00:35:46 -0400 |
|---|---|---|
| committer | Corey Farwell <coreyf@rwell.org> | 2016-03-20 11:01:23 -0400 |
| commit | 77eb78a8c583e17f0cf98a433eb42aa0fc63ce4f (patch) | |
| tree | 9ca92bd7f2fd458de36c4928e0f0c91a900b07c9 | |
| parent | 4238d0b639d4ead97d9cf4ffbb049c0573239cac (diff) | |
Remove double-negative conditionals.
| -rw-r--r-- | src/librustc_driver/lib.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index d4f164b6e24..dc048807bcc 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -335,10 +335,10 @@ pub struct RustcDefaultCalls; fn handle_explain(code: &str, descriptions: &diagnostics::registry::Registry, output: ErrorOutputType) { - let normalised = if !code.starts_with("E") { - format!("E{0:0>4}", code) - } else { + let normalised = if code.starts_with("E") { code.to_string() + } else { + format!("E{0:0>4}", code) }; match descriptions.find_description(&normalised) { Some(ref description) => { @@ -916,10 +916,10 @@ pub fn handle_options(args: &[String]) -> Option<getopts::Matches> { if opt.stability == OptionStability::Stable { continue } - let opt_name = if !opt.opt_group.long_name.is_empty() { - &opt.opt_group.long_name - } else { + let opt_name = if opt.opt_group.long_name.is_empty() { &opt.opt_group.short_name + } else { + &opt.opt_group.long_name }; if !matches.opt_present(opt_name) { continue |
