about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2023-05-24 15:05:05 -0700
committerGitHub <noreply@github.com>2023-05-24 15:05:05 -0700
commitd0b3ebee6605b7b04cc81f32c9743db2970349ce (patch)
treeb4820ace7345ed9708e49d1e55ef4e373f1b28bd /compiler/rustc_data_structures/src
parent33ded73c76b31d25a37ac1c2ea84d03c5a28b215 (diff)
parent307799a711826294bc2b3e562cd87bf1e2ff28b4 (diff)
downloadrust-d0b3ebee6605b7b04cc81f32c9743db2970349ce.tar.gz
rust-d0b3ebee6605b7b04cc81f32c9743db2970349ce.zip
Rollup merge of #111912 - WaffleLapkin:is_some_and_in_the_compiler, r=petrochenkov
Use `Option::is_some_and` and `Result::is_ok_and` in the compiler

`.is_some_and(..)`/`.is_ok_and(..)` replace `.map_or(false, ..)` and `.map(..).unwrap_or(false)`, making the code more readable.

This PR is a sibling of https://github.com/rust-lang/rust/pull/111873#issuecomment-1561316515
Diffstat (limited to 'compiler/rustc_data_structures/src')
-rw-r--r--compiler/rustc_data_structures/src/obligation_forest/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_data_structures/src/obligation_forest/mod.rs b/compiler/rustc_data_structures/src/obligation_forest/mod.rs
index 27a869eb7cd..a47908648ba 100644
--- a/compiler/rustc_data_structures/src/obligation_forest/mod.rs
+++ b/compiler/rustc_data_structures/src/obligation_forest/mod.rs
@@ -366,7 +366,7 @@ impl<O: ForestObligation> ObligationForest<O> {
                     && self
                         .error_cache
                         .get(&obligation_tree_id)
-                        .map_or(false, |errors| errors.contains(v.key()));
+                        .is_some_and(|errors| errors.contains(v.key()));
 
                 if already_failed {
                     Err(())