1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-07-03 03:31:03 +02:00

refactor: fix new pedantic clippy warnings

This commit is contained in:
Jake Stanger 2023-07-16 20:09:22 +01:00
parent 36abe4073e
commit 06251e293e
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
4 changed files with 10 additions and 24 deletions

View file

@ -315,22 +315,6 @@ impl DataControlSourceHandler for Environment {
}
}
}
// for chunk in bytes.chunks(pipe_size as usize) {
// trace!("Writing chunk");
// file.write(chunk).expect("Failed to write chunk to buffer");
// file.flush().expect("Failed to flush to file");
// }
// match file.write_vectored(&bytes.chunks(pipe_size as usize).map(IoSlice::new).collect::<Vec<_>>()) {
// Ok(_) => debug!("Copied item"),
// Err(err) => error!("{err:?}"),
// }
// match file.write_all(bytes) {
// Ok(_) => debug!("Copied item"),
// Err(err) => error!("{err:?}"),
// }
} else {
error!("Failed to find source");
}
@ -375,11 +359,14 @@ fn set_pipe_size(fd: RawFd, size: usize) -> io::Result<i32> {
let new_size = if size > curr_size {
trace!("Requesting pipe size increase to (at least): {size}");
let res = fcntl(fd, F_SETPIPE_SZ(size as i32))?;
trace!("New pipe size: {res}");
if res < size as i32 {
return Err(io::Error::last_os_error());
}
res
} else {
size as i32