mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
fix(clippy): needless_continue
This commit is contained in:
+2
-2
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -464,7 +464,6 @@ fn expand(options: &Options) -> UResult<()> {
|
||||
Err(e) => {
|
||||
show_error!("{e}");
|
||||
set_exit_code(1);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2366,7 +2366,6 @@ fn enter_directory(
|
||||
err,
|
||||
e.command_line
|
||||
));
|
||||
continue;
|
||||
}
|
||||
Ok(rd) => {
|
||||
if listed_ancestors
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(_) => (),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user