From 77eb78a8c583e17f0cf98a433eb42aa0fc63ce4f Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Sun, 20 Mar 2016 00:35:46 -0400 Subject: [PATCH] Remove double-negative conditionals. --- src/librustc_driver/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index d4f164b6e24be..dc048807bcce3 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 { 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