about summary refs log tree commit diff
path: root/compiler/rustc_save_analysis
diff options
context:
space:
mode:
authorLingMan <LingMan@users.noreply.github.com>2021-01-11 20:45:33 +0100
committerLingMan <LingMan@users.noreply.github.com>2021-01-14 19:23:59 +0100
commita56bffb4f9d6f7791b2fa40412bd3e0549d76cc3 (patch)
tree23875d16475aea0b37a608f0ca704a3016c1f0e4 /compiler/rustc_save_analysis
parentd03fe84169d50a4b96cdef7b2f862217ab634055 (diff)
Use Option::map_or instead of `.map(..).unwrap_or(..)`
Diffstat (limited to 'compiler/rustc_save_analysis')
-rw-r--r--compiler/rustc_save_analysis/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_save_analysis/src/lib.rs b/compiler/rustc_save_analysis/src/lib.rs
index c8cdff4f7e5..129123349a0 100644
--- a/compiler/rustc_save_analysis/src/lib.rs
+++ b/compiler/rustc_save_analysis/src/lib.rs
@@ -670,7 +670,7 @@ impl<'tcx> SaveContext<'tcx> {
     ) -> Option<Ref> {
         // Returns true if the path is function type sugar, e.g., `Fn(A) -> B`.
         fn fn_type(seg: &hir::PathSegment<'_>) -> bool {
-            seg.args.map(|args| args.parenthesized).unwrap_or(false)
+            seg.args.map_or(false, |args| args.parenthesized)
         }
 
         let res = self.get_path_res(id);