about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2021-01-15 18:26:14 +0900
committerGitHub <noreply@github.com>2021-01-15 18:26:14 +0900
commita584d874172b85d854f2e4d2a3256f7c23e3183a (patch)
treea19e9e1e49c0735828c8ababae5bacb827ce814c /compiler/rustc_data_structures/src
parent1b8fd02daab85e129f0dda9c92ea11aaa14b7485 (diff)
parenta56bffb4f9d6f7791b2fa40412bd3e0549d76cc3 (diff)
downloadrust-a584d874172b85d854f2e4d2a3256f7c23e3183a.tar.gz
rust-a584d874172b85d854f2e4d2a3256f7c23e3183a.zip
Rollup merge of #80944 - LingMan:map_or, r=nagisa
Use Option::map_or instead of `.map(..).unwrap_or(..)`

``@rustbot`` modify labels +C-cleanup +T-compiler
Diffstat (limited to 'compiler/rustc_data_structures/src')
-rw-r--r--compiler/rustc_data_structures/src/profiling.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_data_structures/src/profiling.rs b/compiler/rustc_data_structures/src/profiling.rs
index 5d13b7f27c7..b16d5a9e2b4 100644
--- a/compiler/rustc_data_structures/src/profiling.rs
+++ b/compiler/rustc_data_structures/src/profiling.rs
@@ -166,7 +166,7 @@ impl SelfProfilerRef {
         // If there is no SelfProfiler then the filter mask is set to NONE,
         // ensuring that nothing ever tries to actually access it.
         let event_filter_mask =
-            profiler.as_ref().map(|p| p.event_filter_mask).unwrap_or(EventFilter::empty());
+            profiler.as_ref().map_or(EventFilter::empty(), |p| p.event_filter_mask);
 
         SelfProfilerRef {
             profiler,