@@ -333,7 +333,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
333
333
let candidates = self
334
334
. r
335
335
. lookup_import_candidates ( ident, ns, & self . parent_scope , is_expected)
336
- . drain ( .. )
336
+ . into_iter ( )
337
337
. filter ( |ImportSuggestion { did, .. } | {
338
338
match ( did, res. and_then ( |res| res. opt_def_id ( ) ) ) {
339
339
( Some ( suggestion_did) , Some ( actual_did) ) => * suggestion_did != actual_did,
@@ -1554,7 +1554,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
1554
1554
if suggest_only_tuple_variants {
1555
1555
// Suggest only tuple variants regardless of whether they have fields and do not
1556
1556
// suggest path with added parentheses.
1557
- let mut suggestable_variants = variants
1557
+ let suggestable_variants = variants
1558
1558
. iter ( )
1559
1559
. filter ( |( .., kind) | * kind == CtorKind :: Fn )
1560
1560
. map ( |( variant, ..) | path_names_to_string ( variant) )
@@ -1580,7 +1580,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
1580
1580
err. span_suggestions (
1581
1581
span,
1582
1582
& msg,
1583
- suggestable_variants. drain ( .. ) ,
1583
+ suggestable_variants. into_iter ( ) ,
1584
1584
Applicability :: MaybeIncorrect ,
1585
1585
) ;
1586
1586
}
@@ -1638,7 +1638,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
1638
1638
) ;
1639
1639
}
1640
1640
1641
- let mut suggestable_variants_with_placeholders = variants
1641
+ let suggestable_variants_with_placeholders = variants
1642
1642
. iter ( )
1643
1643
. filter ( |( _, def_id, kind) | needs_placeholder ( * def_id, * kind) )
1644
1644
. map ( |( variant, _, kind) | ( path_names_to_string ( variant) , kind) )
@@ -1663,7 +1663,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
1663
1663
err. span_suggestions (
1664
1664
span,
1665
1665
msg,
1666
- suggestable_variants_with_placeholders. drain ( .. ) ,
1666
+ suggestable_variants_with_placeholders. into_iter ( ) ,
1667
1667
Applicability :: HasPlaceholders ,
1668
1668
) ;
1669
1669
}
0 commit comments