diff options
| author | est31 <MTest31@outlook.com> | 2022-03-04 10:35:00 +0100 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2022-03-04 10:35:56 +0100 |
| commit | 18528a2ddb84cf62be69d8c8893731e50c859eb9 (patch) | |
| tree | 87ee69c2ed4d5b284e9e0c8a8191f59a8c296da0 | |
| parent | 65f6d33b775eddfc0128c04083bbf3beea360114 (diff) | |
Use if let instead of manual match
| -rw-r--r-- | src/librustdoc/clean/types.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 78928fb4059..c0e7cd0b1f5 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -1506,11 +1506,11 @@ impl Type { } crate fn projection(&self) -> Option<(&Type, DefId, PathSegment)> { - let (self_, trait_, assoc) = match self { - QPath { self_type, trait_, assoc, .. } => (self_type, trait_, assoc), - _ => return None, - }; - Some((&self_, trait_.def_id(), *assoc.clone())) + if let QPath { self_type, trait_, assoc, .. } = self { + Some((&self_type, trait_.def_id(), *assoc.clone())) + } else { + None + } } fn inner_def_id(&self, cache: Option<&Cache>) -> Option<DefId> { |
