Skip to content

Commit 8b2bf81

Browse files
committed
Remove comments
1 parent 80dec53 commit 8b2bf81

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

clippy_lints/src/use_last.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,54 +56,39 @@ impl LintPass for UseLast {
5656
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UseLast {
5757
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
5858
if_chain! {
59-
// let _ = println!("Starting UseLast");
6059
// Is a method call
6160
if let ExprKind::MethodCall(ref path, _, ref args) = expr.node;
62-
// let _ = println!("It is a MethodCall");
6361

6462
// Method name is "get"
6563
if path.ident.name == "get";
66-
// let _ = println!("The name is get");
6764

6865
// Argument 0 (the struct we're calling the method on) is a vector
6966
if let Some(struct_calling_on) = args.get(0);
70-
// let _ = println!("It had an argument");
7167
let struct_ty = cx.tables.expr_ty(struct_calling_on);
7268
if match_type(cx, struct_ty, &paths::VEC);
73-
// let _ = println!("It was a vector");
7469

7570
// Argument to "get" is a binary operation
7671
if let Some(get_index_arg) = args.get(1);
77-
// let _ = println!("It had an argument");
7872
if let rustc::hir::ExprKind::Binary(ref op, ref lhs, ref rhs) = get_index_arg.node;
79-
// let _ = println!("It was a vector");
8073

8174
// Binary operation is a subtraction
8275
if op.node == rustc::hir::BinOpKind::Sub;
83-
// let _ = println!("It was a subtraction");
8476

8577
// LHS of subtraction is "x.len()"
8678
if let ExprKind::MethodCall(ref arg_lhs_path, _, ref lhs_args) = lhs.node;
87-
// let _ = println!("LHS of sub is a method call");
8879
if arg_lhs_path.ident.name == "len";
89-
// let _ = println!("LHS of sub was method named len");
9080
if let Some(arg_lhs_struct) = lhs_args.get(0);
91-
// let _ = println!("LHS of sub method has an arg");
9281

9382
if SpanlessEq::new(cx).eq_expr(struct_calling_on, arg_lhs_struct);
9483

9584
// RHS of subtraction is 1
9685
if let ExprKind::Lit(ref rhs_lit) = rhs.node;
97-
// let _ = println!("RHS of sub was literal");
9886
if let LitKind::Int(rhs_value, ..) = rhs_lit.node;
99-
// let _ = println!("RHS of sub was int");
10087
if rhs_value == 1;
101-
// let _ = println!("RHS of sub was 1");
10288

10389
let mut applicability = Applicability::MachineApplicable;
10490
let vec_name = snippet_with_applicability(
10591
cx, struct_calling_on.span, "x", &mut applicability);
106-
// let _ = println!("About to span_lint on \"{}\"", vec_name);
10792

10893
then {
10994
span_lint_and_sugg(
@@ -117,9 +102,6 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UseLast {
117102
applicability,
118103
);
119104
}
120-
// then {
121-
// let _ = println!("got here");
122-
// }
123105
}
124106
}
125107
}

0 commit comments

Comments
 (0)