1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-02 05:57:46 +00:00

dd: fixing clippy warnings.

This commit is contained in:
Patrick Jackson 2022-06-09 09:27:42 -07:00 committed by Sylvestre Ledru
parent 4cc058a789
commit a186adbff1

View file

@ -606,7 +606,7 @@ impl Write for Output<io::Stdout> {
/// Read helper performs read operations common to all dd reads, and dispatches the buffer to relevant helper functions as dictated by the operations requested by the user. /// Read helper performs read operations common to all dd reads, and dispatches the buffer to relevant helper functions as dictated by the operations requested by the user.
fn read_helper<R: Read>( fn read_helper<R: Read>(
i: &mut Input<R>, i: &mut Input<R>,
mut buf: &mut Vec<u8>, buf: &mut Vec<u8>,
bsize: usize, bsize: usize,
) -> std::io::Result<ReadStat> { ) -> std::io::Result<ReadStat> {
// Local Helper Fns ------------------------------------------------- // Local Helper Fns -------------------------------------------------
@ -621,8 +621,8 @@ fn read_helper<R: Read>(
buf.resize(bsize, BUF_INIT_BYTE); buf.resize(bsize, BUF_INIT_BYTE);
let mut rstat = match i.cflags.sync { let mut rstat = match i.cflags.sync {
Some(ch) => i.fill_blocks(&mut buf, ch)?, Some(ch) => i.fill_blocks(buf, ch)?,
_ => i.fill_consecutive(&mut buf)?, _ => i.fill_consecutive(buf)?,
}; };
// Return early if no data // Return early if no data
if rstat.reads_complete == 0 && rstat.reads_partial == 0 { if rstat.reads_complete == 0 && rstat.reads_partial == 0 {
@ -631,7 +631,7 @@ fn read_helper<R: Read>(
// Perform any conv=x[,x...] options // Perform any conv=x[,x...] options
if i.cflags.swab { if i.cflags.swab {
perform_swab(&mut buf); perform_swab(buf);
} }
match i.cflags.mode { match i.cflags.mode {