1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

fix(clippy): needless_continue

This commit is contained in:
Gabriele Belluardo 2025-06-17 00:06:01 +02:00
parent edfcc2b400
commit e8b6561d4c
No known key found for this signature in database
GPG key ID: 21671B8C89CCBF4F
12 changed files with 11 additions and 16 deletions

View file

@ -437,7 +437,7 @@ impl Read for Input<'_> {
} }
} }
Ok(len) => return Ok(len), Ok(len) => return Ok(len),
Err(e) if e.kind() == io::ErrorKind::Interrupted => continue, Err(e) if e.kind() == io::ErrorKind::Interrupted => (),
Err(_) if self.settings.iconv.noerror => return Ok(base_idx), Err(_) if self.settings.iconv.noerror => return Ok(base_idx),
Err(e) => return Err(e), Err(e) => return Err(e),
} }
@ -861,7 +861,7 @@ impl<'a> Output<'a> {
return Ok(base_idx); return Ok(base_idx);
} }
} }
Err(e) if e.kind() == io::ErrorKind::Interrupted => continue, Err(e) if e.kind() == io::ErrorKind::Interrupted => (),
Err(e) => return Err(e), Err(e) => return Err(e),
} }
} }

View file

@ -464,7 +464,6 @@ fn expand(options: &Options) -> UResult<()> {
Err(e) => { Err(e) => {
show_error!("{e}"); show_error!("{e}");
set_exit_code(1); set_exit_code(1);
continue;
} }
} }
} }

View file

@ -26,7 +26,6 @@ pub fn parse_obsolete(src: &str) -> Option<Result<Vec<OsString>, ParseError>> {
} else if c == '+' && plus_possible { } else if c == '+' && plus_possible {
plus_possible = false; plus_possible = false;
num_start += 1; num_start += 1;
continue;
} else { } else {
num_end = n; num_end = n;
last_char = c; last_char = c;

View file

@ -31,7 +31,7 @@ impl TakeAllBuffer {
self.buffer.truncate(n); self.buffer.truncate(n);
return Ok(n); return Ok(n);
} }
Err(e) if e.kind() == ErrorKind::Interrupted => continue, Err(e) if e.kind() == ErrorKind::Interrupted => (),
Err(e) => return Err(e), Err(e) => return Err(e),
} }
} }

View file

@ -2366,7 +2366,6 @@ fn enter_directory(
err, err,
e.command_line e.command_line
)); ));
continue;
} }
Ok(rd) => { Ok(rd) => {
if listed_ancestors if listed_ancestors

View file

@ -138,7 +138,6 @@ impl Iterator for FilenameIter {
if *index == NAME_CHARSET.len() - 1 { if *index == NAME_CHARSET.len() - 1 {
// Carry the 1 // Carry the 1
*index = 0; *index = 0;
continue;
} else { } else {
*index += 1; *index += 1;
return Some(ret); return Some(ret);

View file

@ -29,7 +29,7 @@ fn bsd_sum(mut reader: impl Read) -> std::io::Result<(usize, u16)> {
rotated.wrapping_add(u16::from(byte)) rotated.wrapping_add(u16::from(byte))
}); });
} }
Err(e) if e.kind() == ErrorKind::Interrupted => continue, Err(e) if e.kind() == ErrorKind::Interrupted => (),
Err(e) => return Err(e), Err(e) => return Err(e),
} }
} }
@ -53,7 +53,7 @@ fn sysv_sum(mut reader: impl Read) -> std::io::Result<(usize, u16)> {
.iter() .iter()
.fold(ret, |acc, &byte| acc.wrapping_add(u32::from(byte))); .fold(ret, |acc, &byte| acc.wrapping_add(u32::from(byte)));
} }
Err(e) if e.kind() == ErrorKind::Interrupted => continue, Err(e) if e.kind() == ErrorKind::Interrupted => (),
Err(e) => return Err(e), Err(e) => return Err(e),
} }
} }

View file

@ -284,7 +284,7 @@ impl Observer {
if let Some(watcher_rx) = &mut self.watcher_rx { if let Some(watcher_rx) = &mut self.watcher_rx {
for input in inputs { for input in inputs {
match input.kind() { match input.kind() {
InputKind::Stdin => continue, InputKind::Stdin => (),
InputKind::File(path) => { InputKind::File(path) => {
#[cfg(all(unix, not(target_os = "linux")))] #[cfg(all(unix, not(target_os = "linux")))]
if !path.is_file() { if !path.is_file() {

View file

@ -393,7 +393,7 @@ fn forwards_thru_file(
} }
total += n; total += n;
} }
Err(e) if e.kind() == ErrorKind::Interrupted => continue, Err(e) if e.kind() == ErrorKind::Interrupted => (),
Err(e) => return Err(e), Err(e) => return Err(e),
} }
} }

View file

@ -192,7 +192,7 @@ pub(crate) fn count_bytes_fast<T: WordCountable>(handle: &mut T) -> (usize, Opti
Ok(n) => { Ok(n) => {
byte_count += n; byte_count += n;
} }
Err(ref e) if e.kind() == ErrorKind::Interrupted => continue, Err(ref e) if e.kind() == ErrorKind::Interrupted => (),
Err(e) => return (byte_count, Some(e)), Err(e) => return (byte_count, Some(e)),
} }
} }
@ -246,7 +246,7 @@ pub(crate) fn count_bytes_chars_and_lines_fast<
total.lines += bytecount::count(&buf[..n], b'\n'); total.lines += bytecount::count(&buf[..n], b'\n');
} }
} }
Err(ref e) if e.kind() == ErrorKind::Interrupted => continue, Err(ref e) if e.kind() == ErrorKind::Interrupted => (),
Err(e) => return (total, Some(e)), Err(e) => return (total, Some(e)),
} }
} }

View file

@ -1063,7 +1063,7 @@ fn process_checksum_file(
} }
Err(CantOpenFile | FileIsDirectory) => res.failed_open_file += 1, Err(CantOpenFile | FileIsDirectory) => res.failed_open_file += 1,
Err(FileNotFound) if !opts.ignore_missing => res.failed_open_file += 1, Err(FileNotFound) if !opts.ignore_missing => res.failed_open_file += 1,
_ => continue, _ => (),
}; };
} }
@ -1132,7 +1132,7 @@ where
match process_checksum_file(filename_input, algo_name_input, length_input, opts) { match process_checksum_file(filename_input, algo_name_input, length_input, opts) {
Err(UError(e)) => return Err(e), Err(UError(e)) => return Err(e),
Err(Failed | CantOpenChecksumFile) => failed = true, Err(Failed | CantOpenChecksumFile) => failed = true,
Ok(_) => continue, Ok(_) => (),
} }
} }

View file

@ -82,7 +82,6 @@ pub fn get_groups() -> IOResult<Vec<gid_t>> {
let err = IOError::last_os_error(); let err = IOError::last_os_error();
if err.raw_os_error() == Some(libc::EINVAL) { if err.raw_os_error() == Some(libc::EINVAL) {
// Number of groups has increased, retry // Number of groups has increased, retry
continue;
} else { } else {
return Err(err); return Err(err);
} }