mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
remove unnecessary lazy evaluations
This commit is contained in:
parent
7530d76f00
commit
cc80c5bd07
31 changed files with 50 additions and 51 deletions
|
@ -91,7 +91,7 @@ fn recursive_merge(lhs: &ast::UseTree, rhs: &ast::UseTree, merge: MergeBehavior)
|
|||
.flat_map(|list| list.use_trees())
|
||||
// We use Option here to early return from this function(this is not the
|
||||
// same as a `filter` op).
|
||||
.map(|tree| merge.is_tree_allowed(&tree).then(|| tree))
|
||||
.map(|tree| merge.is_tree_allowed(&tree).then_some(tree))
|
||||
.collect::<Option<_>>()?;
|
||||
use_trees.sort_unstable_by(|a, b| path_cmp_for_sort(a.path(), b.path()));
|
||||
for rhs_t in rhs.use_tree_list().into_iter().flat_map(|list| list.use_trees()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue