mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-15 01:17:16 +00:00
Cleanup
This commit is contained in:
parent
7a1fc9fce5
commit
a3c505551f
1 changed files with 6 additions and 6 deletions
|
@ -672,20 +672,20 @@ fn lint_cstring_as_ptr(cx: &LateContext, expr: &hir::Expr, new: &hir::Expr, unwr
|
||||||
#[allow(ptr_arg)]
|
#[allow(ptr_arg)]
|
||||||
// Type of MethodArgs is potentially a Vec
|
// Type of MethodArgs is potentially a Vec
|
||||||
fn lint_iter_nth(cx: &LateContext, expr: &hir::Expr, iter_args: &MethodArgs, is_mut: bool){
|
fn lint_iter_nth(cx: &LateContext, expr: &hir::Expr, iter_args: &MethodArgs, is_mut: bool){
|
||||||
let caller_type;
|
|
||||||
let mut_str = if is_mut { "_mut" } else {""};
|
let mut_str = if is_mut { "_mut" } else {""};
|
||||||
if let Some(_) = derefs_to_slice(cx, &iter_args[0], &cx.tcx.expr_ty(&iter_args[0])) {
|
let caller_type = if let Some(_) = derefs_to_slice(cx, &iter_args[0], &cx.tcx.expr_ty(&iter_args[0])) {
|
||||||
caller_type = "slice";
|
"slice"
|
||||||
}
|
}
|
||||||
else if match_type(cx, cx.tcx.expr_ty(&iter_args[0]), &paths::VEC) {
|
else if match_type(cx, cx.tcx.expr_ty(&iter_args[0]), &paths::VEC) {
|
||||||
caller_type = "Vec";
|
"Vec"
|
||||||
}
|
}
|
||||||
else if match_type(cx, cx.tcx.expr_ty(&iter_args[0]), &paths::VEC_DEQUE) {
|
else if match_type(cx, cx.tcx.expr_ty(&iter_args[0]), &paths::VEC_DEQUE) {
|
||||||
caller_type = "VecDeque";
|
"VecDeque"
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return; // caller is not a type that we want to lint
|
return; // caller is not a type that we want to lint
|
||||||
}
|
};
|
||||||
|
|
||||||
span_lint(
|
span_lint(
|
||||||
cx,
|
cx,
|
||||||
ITER_NTH,
|
ITER_NTH,
|
||||||
|
|
Loading…
Reference in a new issue