about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2023-11-25 10:21:06 +0100
committerGitHub <noreply@github.com>2023-11-25 10:21:06 +0100
commit8e606a6928dc5ae15ab7c5cc579bb9d17845c8a1 (patch)
tree66c684c4b36c2f5e1b1b8297295f71d697416df8 /src/tools
parent0304aac0f3f740449f373971cdfa51a14576eab8 (diff)
parent8cc7073d64578c81f5e6ed23120733040a22d78a (diff)
downloadrust-8e606a6928dc5ae15ab7c5cc579bb9d17845c8a1.tar.gz
rust-8e606a6928dc5ae15ab7c5cc579bb9d17845c8a1.zip
Rollup merge of #118253 - dtolnay:issomeand, r=compiler-errors
Replace `option.map(cond) == Some(true)` with `option.is_some_and(cond)`

Requested by `@fmease` in https://github.com/rust-lang/rust/pull/118226#pullrequestreview-1747432292.

There is also a much larger number of `option.map_or(false, cond)` that can be changed separately if someone wants.

r? fmease
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/compiletest/src/header.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs
index d6516cff63f..f85f9e674ab 100644
--- a/src/tools/compiletest/src/header.rs
+++ b/src/tools/compiletest/src/header.rs
@@ -632,7 +632,7 @@ fn iter_header_extra(
         it(None, directive, 0);
     }
 
-    let comment = if testfile.extension().map(|e| e == "rs") == Some(true) { "//" } else { "#" };
+    let comment = if testfile.extension().is_some_and(|e| e == "rs") { "//" } else { "#" };
 
     let mut rdr = BufReader::new(rdr);
     let mut ln = String::new();