Skip to content

Commit ecb472c

Browse files
committed
Use fn instead of closures where unnecessary
1 parent 3f1e51b commit ecb472c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clippy_lints/src/loops.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ fn detect_manual_memcpy<'a, 'tcx>(
958958
{
959959
// the var must be a single name
960960
if let PatKind::Binding(_, canonical_id, _, _) = pat.kind {
961-
let print_sum = |arg1: &str, arg2: &Offset| -> String {
961+
fn print_sum(arg1: &str, arg2: &Offset) -> String {
962962
match (arg1, &arg2.value[..], arg2.sign) {
963963
("0", "0", _) => "0".into(),
964964
("0", x, OffsetSign::Positive) | (x, "0", _) => x.into(),
@@ -972,16 +972,16 @@ fn detect_manual_memcpy<'a, 'tcx>(
972972
}
973973
},
974974
}
975-
};
975+
}
976976

977-
let print_offset = |start_str: &str, inline_offset: &Offset| -> String {
977+
fn print_offset(start_str: &str, inline_offset: &Offset) -> String {
978978
let offset = print_sum(start_str, inline_offset);
979979
if offset.as_str() == "0" {
980980
"".into()
981981
} else {
982982
offset
983983
}
984-
};
984+
}
985985

986986
let print_limit = |end: &Expr<'_>, offset: Offset, var_name: &str| {
987987
if_chain! {

0 commit comments

Comments
 (0)