aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_assists/src/handlers
diff options
context:
space:
mode:
authorMatthias Krüger <[email protected]>2021-03-17 01:34:46 +0000
committerMatthias Krüger <[email protected]>2021-03-17 01:36:29 +0000
commitff5f90d8ae2da8e4856d5c78f55e5cd02b178325 (patch)
tree68a4b706477487e466d9d33e577f7cb6dbf2bf50 /crates/ide_assists/src/handlers
parent64b91393b85eb2b5d41ccbd3048dcc61eb8061c7 (diff)
use simpler .map(|x| y) instead of .and_then(|x| Some(y)) for Options. (clippy::bind_instead_of_map)
Diffstat (limited to 'crates/ide_assists/src/handlers')
-rw-r--r--crates/ide_assists/src/handlers/expand_glob_import.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ide_assists/src/handlers/expand_glob_import.rs b/crates/ide_assists/src/handlers/expand_glob_import.rs
index 5b540df5c..83aa11d52 100644
--- a/crates/ide_assists/src/handlers/expand_glob_import.rs
+++ b/crates/ide_assists/src/handlers/expand_glob_import.rs
@@ -73,8 +73,8 @@ fn find_parent_and_path(
73) -> Option<(Either<ast::UseTree, ast::UseTreeList>, ast::Path)> { 73) -> Option<(Either<ast::UseTree, ast::UseTreeList>, ast::Path)> {
74 return star.ancestors().find_map(|n| { 74 return star.ancestors().find_map(|n| {
75 find_use_tree_list(n.clone()) 75 find_use_tree_list(n.clone())
76 .and_then(|(u, p)| Some((Either::Right(u), p))) 76 .map(|(u, p)| (Either::Right(u), p))
77 .or_else(|| find_use_tree(n).and_then(|(u, p)| Some((Either::Left(u), p)))) 77 .or_else(|| find_use_tree(n).map(|(u, p)| (Either::Left(u), p)))
78 }); 78 });
79 79
80 fn find_use_tree_list(n: SyntaxNode) -> Option<(ast::UseTreeList, ast::Path)> { 80 fn find_use_tree_list(n: SyntaxNode) -> Option<(ast::UseTreeList, ast::Path)> {