Skip to content

Commit 51585a1

Browse files
committed
Removed unused lifetimes and a needless bool
1 parent be9f7c2 commit 51585a1

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

clippy_lints/src/loops.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -775,10 +775,9 @@ fn same_var<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &Expr<'_>, var: HirId) -
775775
if let QPath::Resolved(None, path) = qpath;
776776
if path.segments.len() == 1;
777777
if let Res::Local(local_id) = qpath_res(cx, qpath, expr.hir_id);
778-
// our variable!
779-
if local_id == var;
780778
then {
781-
true
779+
// our variable!
780+
local_id == var
782781
} else {
783782
false
784783
}
@@ -870,10 +869,8 @@ fn get_offset<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, idx: &Expr<'_>, var: HirId)
870869
}
871870
}
872871

873-
fn get_assignments<'a, 'tcx>(
874-
body: &'tcx Expr<'tcx>,
875-
) -> impl Iterator<Item = Option<(&'tcx Expr<'tcx>, &'tcx Expr<'tcx>)>> {
876-
fn get_assignment<'a, 'tcx>(e: &'tcx Expr<'tcx>) -> Option<(&'tcx Expr<'tcx>, &'tcx Expr<'tcx>)> {
872+
fn get_assignments<'tcx>(body: &'tcx Expr<'tcx>) -> impl Iterator<Item = Option<(&'tcx Expr<'tcx>, &'tcx Expr<'tcx>)>> {
873+
fn get_assignment<'tcx>(e: &'tcx Expr<'tcx>) -> Option<(&'tcx Expr<'tcx>, &'tcx Expr<'tcx>)> {
877874
if let ExprKind::Assign(lhs, rhs, _) = e.kind {
878875
Some((lhs, rhs))
879876
} else {

0 commit comments

Comments
 (0)