mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-03 20:23:59 +00:00
chore
This commit is contained in:
parent
b13704a9cd
commit
f5fd9ded00
@ -335,7 +335,7 @@ pub(super) fn make_iterator_snippet(cx: &LateContext<'_>, arg: &Expr<'_>, applic
|
|||||||
let arg_ty = cx.typeck_results().expr_ty_adjusted(arg);
|
let arg_ty = cx.typeck_results().expr_ty_adjusted(arg);
|
||||||
match &arg_ty.kind() {
|
match &arg_ty.kind() {
|
||||||
ty::Ref(_, inner_ty, mutbl) if has_iter_method(cx, inner_ty).is_some() => {
|
ty::Ref(_, inner_ty, mutbl) if has_iter_method(cx, inner_ty).is_some() => {
|
||||||
let meth_name = match mutbl {
|
let method_name = match mutbl {
|
||||||
Mutability::Mut => "iter_mut",
|
Mutability::Mut => "iter_mut",
|
||||||
Mutability::Not => "iter",
|
Mutability::Not => "iter",
|
||||||
};
|
};
|
||||||
@ -346,7 +346,7 @@ pub(super) fn make_iterator_snippet(cx: &LateContext<'_>, arg: &Expr<'_>, applic
|
|||||||
format!(
|
format!(
|
||||||
"{}.{}()",
|
"{}.{}()",
|
||||||
sugg::Sugg::hir_with_applicability(cx, caller, "_", applic_ref).maybe_par(),
|
sugg::Sugg::hir_with_applicability(cx, caller, "_", applic_ref).maybe_par(),
|
||||||
meth_name,
|
method_name,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
_ => format!(
|
_ => format!(
|
||||||
|
Loading…
Reference in New Issue
Block a user