Skip to content

Commit

Permalink
Silence clippy::unused_io_amount in various places
Browse files Browse the repository at this point in the history
Way too many false positives.
  • Loading branch information
Thomasdezeeuw committed Apr 24, 2024
1 parent a508c78 commit e093d78
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/tcp_listenfd_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ fn handle_connection_event(
) -> io::Result<bool> {
if event.is_writable() {
// We can (maybe) write to the connection.
#[allow(clippy::unused_io_amount)]
match connection.write(DATA) {
// We want to write the entire `DATA` buffer in a single go. If we
// write less we'll return a short write error (same as
Expand Down
2 changes: 2 additions & 0 deletions src/sys/unix/waker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ mod eventfd {

pub fn wake(&self) -> io::Result<()> {
let buf: [u8; 8] = 1u64.to_ne_bytes();
#[allow(clippy::unused_io_amount)]
match (&self.fd).write(&buf) {
Ok(_) => Ok(()),
Err(ref err) if err.kind() == io::ErrorKind::WouldBlock => {
Expand All @@ -122,6 +123,7 @@ mod eventfd {
/// Reset the eventfd object, only need to call this if `wake` fails.
fn reset(&self) -> io::Result<()> {
let mut buf: [u8; 8] = 0u64.to_ne_bytes();
#[allow(clippy::unused_io_amount)]
match (&self.fd).read(&mut buf) {
Ok(_) => Ok(()),
// If the `Waker` hasn't been awoken yet this will return a
Expand Down
1 change: 1 addition & 0 deletions tests/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ fn write_error() {

let buf = [0; 1024];
loop {
#[allow(clippy::unused_io_amount)]
match s.write(&buf) {
Ok(_) => {}
Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => wait_writable(),
Expand Down

0 comments on commit e093d78

Please sign in to comment.