diff options
| author | Joshua Nelson <jyn514@gmail.com> | 2020-08-25 22:00:25 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-25 22:00:25 -0400 |
| commit | bb351defba42f5019d4ab34f2baf43c703519067 (patch) | |
| tree | 76057ffff397c3dd2db9280fe70b7be5f2c45bd0 | |
| parent | e233d80808d338f025511bc0558319a6dd3acc93 (diff) | |
| download | rust-bb351defba42f5019d4ab34f2baf43c703519067.tar.gz rust-bb351defba42f5019d4ab34f2baf43c703519067.zip | |
Use map_or(true) instead of unwrap_or(true)
Co-authored-by: Ivan Tham <pickfire@riseup.net>
| -rw-r--r-- | src/librustc_hir/def.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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<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) } } |
