Skip to content

Commit

Permalink
Simplify map | unwrap_or to map_or
Browse files Browse the repository at this point in the history
  • Loading branch information
tamird committed May 18, 2021
1 parent a36c636 commit 42b9d3f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions compiler/rustc_data_structures/src/obligation_forest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,7 @@ impl<O: ForestObligation> ObligationForest<O> {
&& self
.error_cache
.get(&obligation_tree_id)
.map(|errors| errors.contains(v.key()))
.unwrap_or(false);
.map_or(false, |errors| errors.contains(v.key()));

if already_failed {
Err(())
Expand Down

0 comments on commit 42b9d3f

Please sign in to comment.