Skip to content

Commit 1e436eb

Browse files
committed
return the boolean value directly instead of using if-else
Previous patch introduced something like if x {true} else {false} which can be simply replaced by returning x here. Thanks to @kennytm for spotting it.
1 parent fd075c6 commit 1e436eb

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/tools/compiletest/src/header.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -570,11 +570,7 @@ impl Config {
570570
// returns whether this line contains this prefix or not. For prefix
571571
// "ignore", returns true if line says "ignore-x86_64", "ignore-arch",
572572
// "ignore-andorid" etc.
573-
if line.starts_with(prefix) && line.as_bytes().get(prefix.len()) == Some(&b'-') {
574-
true
575-
} else {
576-
false
577-
}
573+
line.starts_with(prefix) && line.as_bytes().get(prefix.len()) == Some(&b'-')
578574
}
579575

580576
fn parse_name_directive(&self, line: &str, directive: &str) -> bool {

0 commit comments

Comments
 (0)