diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-04-15 20:18:30 +0200 | 
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2023-04-16 13:28:13 +0200 | 
| commit | 543f8bc38c78c05319b5774ec2337c6d3c9b434b (patch) | |
| tree | ff617ed6f58a0e2622730499574eceb7bbccf461 /src/librustdoc/formats/cache.rs | |
| parent | e6e956dade79bdc084dfe3078abab24656a1b483 (diff) | |
| download | rust-543f8bc38c78c05319b5774ec2337c6d3c9b434b.tar.gz rust-543f8bc38c78c05319b5774ec2337c6d3c9b434b.zip | |
fix clippy::toplevel_ref_arg and ::manual_map
Diffstat (limited to 'src/librustdoc/formats/cache.rs')
| -rw-r--r-- | src/librustdoc/formats/cache.rs | 7 | 
1 files changed, 3 insertions, 4 deletions
| diff --git a/src/librustdoc/formats/cache.rs b/src/librustdoc/formats/cache.rs index c0329182032..841abfab666 100644 --- a/src/librustdoc/formats/cache.rs +++ b/src/librustdoc/formats/cache.rs @@ -300,14 +300,13 @@ impl<'a, 'tcx> DocFolder for CacheBuilder<'a, 'tcx> { ParentStackItem::Impl { for_, .. } => for_.def_id(&self.cache), ParentStackItem::Type(item_id) => item_id.as_def_id(), }; - let path = match did.and_then(|did| self.cache.paths.get(&did)) { + let path = did + .and_then(|did| self.cache.paths.get(&did)) // The current stack not necessarily has correlation // for where the type was defined. On the other // hand, `paths` always has the right // information if present. - Some((fqp, _)) => Some(&fqp[..fqp.len() - 1]), - None => None, - }; + .map(|(fqp, _)| &fqp[..fqp.len() - 1]); ((did, path), true) } } | 
