Skip to content

Commit 77eb78a

Browse files
committed
Remove double-negative conditionals.
1 parent 4238d0b commit 77eb78a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/librustc_driver/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,10 @@ pub struct RustcDefaultCalls;
335335
fn handle_explain(code: &str,
336336
descriptions: &diagnostics::registry::Registry,
337337
output: ErrorOutputType) {
338-
let normalised = if !code.starts_with("E") {
339-
format!("E{0:0>4}", code)
340-
} else {
338+
let normalised = if code.starts_with("E") {
341339
code.to_string()
340+
} else {
341+
format!("E{0:0>4}", code)
342342
};
343343
match descriptions.find_description(&normalised) {
344344
Some(ref description) => {
@@ -916,10 +916,10 @@ pub fn handle_options(args: &[String]) -> Option<getopts::Matches> {
916916
if opt.stability == OptionStability::Stable {
917917
continue
918918
}
919-
let opt_name = if !opt.opt_group.long_name.is_empty() {
920-
&opt.opt_group.long_name
921-
} else {
919+
let opt_name = if opt.opt_group.long_name.is_empty() {
922920
&opt.opt_group.short_name
921+
} else {
922+
&opt.opt_group.long_name
923923
};
924924
if !matches.opt_present(opt_name) {
925925
continue

0 commit comments

Comments
 (0)