mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-16 00:43:50 +00:00
Use map_or(true) instead of unwrap_or(true)
Co-authored-by: Ivan Tham <pickfire@riseup.net>
This commit is contained in:
parent
e233d80808
commit
bb351defba
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user