From ff5f90d8ae2da8e4856d5c78f55e5cd02b178325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 17 Mar 2021 02:34:46 +0100 Subject: use simpler .map(|x| y) instead of .and_then(|x| Some(y)) for Options. (clippy::bind_instead_of_map) --- crates/ide_assists/src/handlers/expand_glob_import.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ide_assists/src') 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( ) -> Option<(Either, ast::Path)> { return star.ancestors().find_map(|n| { find_use_tree_list(n.clone()) - .and_then(|(u, p)| Some((Either::Right(u), p))) - .or_else(|| find_use_tree(n).and_then(|(u, p)| Some((Either::Left(u), p)))) + .map(|(u, p)| (Either::Right(u), p)) + .or_else(|| find_use_tree(n).map(|(u, p)| (Either::Left(u), p))) }); fn find_use_tree_list(n: SyntaxNode) -> Option<(ast::UseTreeList, ast::Path)> { -- cgit v1.2.3