aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/descriptors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis/src/descriptors.rs')
-rw-r--r--crates/ra_analysis/src/descriptors.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/ra_analysis/src/descriptors.rs b/crates/ra_analysis/src/descriptors.rs
index 310bf1585..92da26493 100644
--- a/crates/ra_analysis/src/descriptors.rs
+++ b/crates/ra_analysis/src/descriptors.rs
@@ -22,7 +22,7 @@ impl ModuleDescriptor {
22 } 22 }
23} 23}
24 24
25fn modules<'a>(root: ast::Root<'a>) -> impl Iterator<Item = (SmolStr, ast::Module<'a>)> { 25fn modules(root: ast::Root<'_>) -> impl Iterator<Item = (SmolStr, ast::Module<'_>)> {
26 root.modules().filter_map(|module| { 26 root.modules().filter_map(|module| {
27 let name = module.name()?.text(); 27 let name = module.name()?.text();
28 if !module.has_semi() { 28 if !module.has_semi() {
@@ -184,8 +184,7 @@ impl Link {
184 root: ast::Root<'a>, 184 root: ast::Root<'a>,
185 ) -> ast::Module<'a> { 185 ) -> ast::Module<'a> {
186 modules(root) 186 modules(root)
187 .filter(|(name, _)| name == &tree.link(self).name) 187 .find(|(name, _)| name == &tree.link(self).name)
188 .next()
189 .unwrap() 188 .unwrap()
190 .1 189 .1
191 } 190 }