From 307799a711826294bc2b3e562cd87bf1e2ff28b4 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Wed, 24 May 2023 14:33:43 +0000 Subject: Use `is_some_and`/`is_ok_and` in less obvious spots --- compiler/rustc_parse/src/parser/diagnostics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_parse/src/parser') diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index 681e0f79957..c1454039685 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -2610,7 +2610,7 @@ impl<'a> Parser<'a> { let TyKind::Path(qself, path) = &ty.kind else { return Ok(()) }; let qself_position = qself.as_ref().map(|qself| qself.position); for (i, segments) in path.segments.windows(2).enumerate() { - if qself_position.map(|pos| i < pos).unwrap_or(false) { + if qself_position.is_some_and(|pos| i < pos) { continue; } if let [a, b] = segments { -- cgit 1.4.1-3-g733a5