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.

Backport of 8a1bfe1
  • Loading branch information
Thomasdezeeuw committed Apr 24, 2024
1 parent a508c78 commit ab2ab15
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 @@ -125,6 +125,7 @@ fn next(current: &mut Token) -> Token {
}

/// Returns `true` if the connection is done.
#[allow(clippy::unused_io_amount)]
fn handle_connection_event(
registry: &Registry,
connection: &mut TcpStream,
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 @@ -100,6 +100,7 @@ mod eventfd {
Ok(WakerInternal { fd: file })
}

#[allow(clippy::unused_io_amount)]
pub fn wake(&self) -> io::Result<()> {
let buf: [u8; 8] = 1u64.to_ne_bytes();
match (&self.fd).write(&buf) {
Expand All @@ -120,6 +121,7 @@ mod eventfd {
}

/// Reset the eventfd object, only need to call this if `wake` fails.
#[allow(clippy::unused_io_amount)]
fn reset(&self) -> io::Result<()> {
let mut buf: [u8; 8] = 0u64.to_ne_bytes();
match (&self.fd).read(&mut buf) {
Expand Down
1 change: 1 addition & 0 deletions tests/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ fn connect_error() {
}

#[test]
#[allow(clippy::unused_io_amount)]
fn write_error() {
init();

Expand Down

0 comments on commit ab2ab15

Please sign in to comment.