Replace option.map(cond) == Some(true) with option.is_some_and(cond)

This commit is contained in:
David Tolnay 2023-11-24 08:49:37 -08:00
parent beebcdeb6f
commit 8cc7073d64
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
8 changed files with 21 additions and 22 deletions

View file

@ -135,7 +135,7 @@ pub(crate) fn matches_codepattern(a: &str, b: &str) -> bool {
/// Advances the given peekable `Iterator` until it reaches a non-whitespace character.
fn scan_for_non_ws_or_end<I: Iterator<Item = char>>(iter: &mut Peekable<I>) {
while iter.peek().copied().map(rustc_lexer::is_whitespace) == Some(true) {
while iter.peek().copied().is_some_and(rustc_lexer::is_whitespace) {
iter.next();
}
}