Use map_or(true) instead of unwrap_or(true)

Co-authored-by: Ivan Tham <pickfire@riseup.net>
This commit is contained in:
Joshua Nelson 2020-08-25 22:00:25 -04:00 committed by GitHub
parent e233d80808
commit bb351defba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -464,6 +464,6 @@ impl<Id> Res<Id> {
/// 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)
}
}