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),
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(e) => return Err(e),
}
@ -861,7 +861,7 @@ impl<'a> Output<'a> {
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),
}
}

View file

@ -464,7 +464,6 @@ fn expand(options: &Options) -> UResult<()> {
Err(e) => {
show_error!("{e}");
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 {
plus_possible = false;
num_start += 1;
continue;
} else {
num_end = n;
last_char = c;

View file

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

View file

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

View file

@ -138,7 +138,6 @@ impl Iterator for FilenameIter {
if *index == NAME_CHARSET.len() - 1 {
// Carry the 1
*index = 0;
continue;
} else {
*index += 1;
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))
});
}
Err(e) if e.kind() == ErrorKind::Interrupted => continue,
Err(e) if e.kind() == ErrorKind::Interrupted => (),
Err(e) => return Err(e),
}
}
@ -53,7 +53,7 @@ fn sysv_sum(mut reader: impl Read) -> std::io::Result<(usize, u16)> {
.iter()
.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),
}
}

View file

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

View file

@ -393,7 +393,7 @@ fn forwards_thru_file(
}
total += n;
}
Err(e) if e.kind() == ErrorKind::Interrupted => continue,
Err(e) if e.kind() == ErrorKind::Interrupted => (),
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) => {
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)),
}
}
@ -246,7 +246,7 @@ pub(crate) fn count_bytes_chars_and_lines_fast<
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)),
}
}

View file

@ -1063,7 +1063,7 @@ fn process_checksum_file(
}
Err(CantOpenFile | FileIsDirectory) => 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) {
Err(UError(e)) => return Err(e),
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();
if err.raw_os_error() == Some(libc::EINVAL) {
// Number of groups has increased, retry
continue;
} else {
return Err(err);
}