]> git.lizzy.rs Git - rust.git/commitdiff
Use map_or(true) instead of unwrap_or(true)
authorJoshua Nelson <jyn514@gmail.com>
Wed, 26 Aug 2020 02:00:25 +0000 (22:00 -0400)
committerGitHub <noreply@github.com>
Wed, 26 Aug 2020 02:00:25 +0000 (22:00 -0400)
Co-authored-by: Ivan Tham <pickfire@riseup.net>
src/librustc_hir/def.rs

index 72310061d5cb5de1efb52b1971e149fe38ed1825..0d61dc037c65a56f6eaaa64542df6896b88b629c 100644 (file)
@@ -464,6 +464,6 @@ pub fn ns(&self) -> Option<Namespace> {
 
     /// 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)
     }
 }