From a56bffb4f9d6f7791b2fa40412bd3e0549d76cc3 Mon Sep 17 00:00:00 2001 From: LingMan Date: Mon, 11 Jan 2021 20:45:33 +0100 Subject: Use Option::map_or instead of `.map(..).unwrap_or(..)` --- compiler/rustc_data_structures/src/profiling.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_data_structures/src') 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, -- cgit 1.4.1-3-g733a5