diff options
| author | Tamir Duberstein <tamird@google.com> | 2021-05-18 10:37:42 -0400 |
|---|---|---|
| committer | Tamir Duberstein <tamird@google.com> | 2021-05-18 10:37:42 -0400 |
| commit | 42b9d3fb723f33d903e1ef54a3f2439153b3a552 (patch) | |
| tree | 4cea64a7abce1559b3d7789d1352d5c734ec57e3 | |
| parent | a36c6361999ff23d604a5a0e7d06611ad31b6262 (diff) | |
| download | rust-42b9d3fb723f33d903e1ef54a3f2439153b3a552.tar.gz rust-42b9d3fb723f33d903e1ef54a3f2439153b3a552.zip | |
Simplify `map | unwrap_or` to `map_or`
| -rw-r--r-- | compiler/rustc_data_structures/src/obligation_forest/mod.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_data_structures/src/obligation_forest/mod.rs b/compiler/rustc_data_structures/src/obligation_forest/mod.rs index 74ceed67807..d8f23aeabc1 100644 --- a/compiler/rustc_data_structures/src/obligation_forest/mod.rs +++ b/compiler/rustc_data_structures/src/obligation_forest/mod.rs @@ -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(()) |
