about summary refs log tree commit diff
diff options
context:
space:
mode:
authorrail <12975677+rail-rain@users.noreply.github.com>2020-04-27 19:02:08 +1200
committerrail <12975677+rail-rain@users.noreply.github.com>2020-04-27 19:02:08 +1200
commitecb472c052c746d87ce26f6b184f2c5f11537e0c (patch)
treec2bfa9c18ca2d3a1ac9c23fb70ec9673c945fa33
parent3f1e51b3f4a7bfb42c442caf2cb836ba62e2ba53 (diff)
downloadrust-ecb472c052c746d87ce26f6b184f2c5f11537e0c.tar.gz
rust-ecb472c052c746d87ce26f6b184f2c5f11537e0c.zip
Use `fn` instead of closures where unnecessary
-rw-r--r--clippy_lints/src/loops.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/clippy_lints/src/loops.rs b/clippy_lints/src/loops.rs
index 321d5265d0c..e37c44dc026 100644
--- a/clippy_lints/src/loops.rs
+++ b/clippy_lints/src/loops.rs
@@ -958,7 +958,7 @@ fn detect_manual_memcpy<'a, 'tcx>(
     {
         // the var must be a single name
         if let PatKind::Binding(_, canonical_id, _, _) = pat.kind {
-            let print_sum = |arg1: &str, arg2: &Offset| -> String {
+            fn print_sum(arg1: &str, arg2: &Offset) -> String {
                 match (arg1, &arg2.value[..], arg2.sign) {
                     ("0", "0", _) => "0".into(),
                     ("0", x, OffsetSign::Positive) | (x, "0", _) => x.into(),
@@ -972,16 +972,16 @@ fn detect_manual_memcpy<'a, 'tcx>(
                         }
                     },
                 }
-            };
+            }
 
-            let print_offset = |start_str: &str, inline_offset: &Offset| -> String {
+            fn print_offset(start_str: &str, inline_offset: &Offset) -> String {
                 let offset = print_sum(start_str, inline_offset);
                 if offset.as_str() == "0" {
                     "".into()
                 } else {
                     offset
                 }
-            };
+            }
 
             let print_limit = |end: &Expr<'_>, offset: Offset, var_name: &str| {
                 if_chain! {