Skip to content

Commit bb351de

Browse files
jyn514pickfire
andauthored
Use map_or(true) instead of unwrap_or(true)
Co-authored-by: Ivan Tham <[email protected]>
1 parent e233d80 commit bb351de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_hir/def.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,6 @@ impl<Id> Res<Id> {
464464

465465
/// Always returns `true` if `self` is `Res::Err`
466466
pub fn matches_ns(&self, ns: Namespace) -> bool {
467-
self.ns().map(|actual_ns| actual_ns == ns).unwrap_or(true)
467+
self.ns().map_or(true, |actual_ns| actual_ns == ns)
468468
}
469469
}

0 commit comments

Comments
 (0)