about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPulkit Goyal <7895pulkit@gmail.com>2018-01-16 15:02:29 +0530
committerPulkit Goyal <7895pulkit@gmail.com>2018-01-16 15:02:29 +0530
commit1e436eb236b2f6ae37971669d2a633cb0a778be6 (patch)
tree85a385ad0881afd82d252077e7e5efabba82827f /src
parentfd075c6f2144b33385a596b36eece02ed5d8be62 (diff)
downloadrust-1e436eb236b2f6ae37971669d2a633cb0a778be6.tar.gz
rust-1e436eb236b2f6ae37971669d2a633cb0a778be6.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/tools/compiletest/src/header.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs
index 475991d7b8b..478a692df91 100644
--- a/src/tools/compiletest/src/header.rs
+++ b/src/tools/compiletest/src/header.rs
@@ -570,11 +570,7 @@ impl Config {
         // returns whether this line contains this prefix or not. For prefix
         // "ignore", returns true if line says "ignore-x86_64", "ignore-arch",
         // "ignore-andorid" etc.
-        if line.starts_with(prefix) && line.as_bytes().get(prefix.len()) == Some(&b'-') {
-            true
-        } else {
-            false
-        }
+        line.starts_with(prefix) && line.as_bytes().get(prefix.len()) == Some(&b'-')
     }
 
     fn parse_name_directive(&self, line: &str, directive: &str) -> bool {