From bb351defba42f5019d4ab34f2baf43c703519067 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Tue, 25 Aug 2020 22:00:25 -0400 Subject: [PATCH] Use map_or(true) instead of unwrap_or(true) Co-authored-by: Ivan Tham --- src/librustc_hir/def.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_hir/def.rs b/src/librustc_hir/def.rs index 72310061d5c..0d61dc037c6 100644 --- a/src/librustc_hir/def.rs +++ b/src/librustc_hir/def.rs @@ -464,6 +464,6 @@ impl Res { /// Always returns `true` if `self` is `Res::Err` pub fn matches_ns(&self, ns: Namespace) -> bool { - self.ns().map(|actual_ns| actual_ns == ns).unwrap_or(true) + self.ns().map_or(true, |actual_ns| actual_ns == ns) } }