From 49e4eba078d27e81566c327a550bcac176774f6f Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Thu, 7 Aug 2025 14:51:51 +0200 Subject: [PATCH] clippy: fix warnings from needless_return lint --- src/uu/od/src/prn_float.rs | 2 +- src/uu/split/src/split.rs | 8 ++++---- src/uucore/src/lib/features/checksum.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/uu/od/src/prn_float.rs b/src/uu/od/src/prn_float.rs index 37059e226..2e1ff6988 100644 --- a/src/uu/od/src/prn_float.rs +++ b/src/uu/od/src/prn_float.rs @@ -120,7 +120,7 @@ fn format_float(f: f64, width: usize, precision: usize) -> String { } else if l == -1 { format!("{f:width$.precision$}") } else { - return format_f64_exp_precision(f, width, precision - 1); // subnormal numbers + format_f64_exp_precision(f, width, precision - 1) // subnormal numbers } } diff --git a/src/uu/split/src/split.rs b/src/uu/split/src/split.rs index ca4eb4e84..b8351c31e 100644 --- a/src/uu/split/src/split.rs +++ b/src/uu/split/src/split.rs @@ -630,9 +630,9 @@ where } else if input == "-" { // STDIN stream that did not fit all content into a buffer // Most likely continuous/infinite input stream - return Err(io::Error::other( + Err(io::Error::other( translate!("split-error-cannot-determine-input-size", "input" => input), - )); + )) } else { // Could be that file size is larger than set read limit // Get the file size from filesystem metadata @@ -655,9 +655,9 @@ where // Give up and return an error // TODO It might be possible to do more here // to address all possible file types and edge cases - return Err(io::Error::other( + Err(io::Error::other( translate!("split-error-cannot-determine-file-size", "input" => input), - )); + )) } } } diff --git a/src/uucore/src/lib/features/checksum.rs b/src/uucore/src/lib/features/checksum.rs index 0dfd4c84f..703098794 100644 --- a/src/uucore/src/lib/features/checksum.rs +++ b/src/uucore/src/lib/features/checksum.rs @@ -989,7 +989,7 @@ fn process_checksum_line( process_non_algo_based_line(i, &line_info, cli_algo, cli_algo_length, opts) } else { // We have no clue of what algorithm to use - return Err(LineCheckError::ImproperlyFormatted); + Err(LineCheckError::ImproperlyFormatted) } }