Skip to content

Commit

Permalink
Fix Clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomasdezeeuw committed Oct 8, 2021
1 parent 37aec3e commit b48cce6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/sys/unix/selector/kqueue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ fn kevent_register(
Err(err)
}
})
.and_then(|()| check_errors(&changes, ignored_errors))
.and_then(|()| check_errors(changes, ignored_errors))
}

/// Check all events for possible errors, it returns the first error found.
Expand Down
12 changes: 6 additions & 6 deletions tests/tcp_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ where
assert_eq!(stream.peer_addr().unwrap(), addr);
assert!(stream.local_addr().unwrap().ip().is_loopback());

checked_write!(stream.write(&DATA1));
checked_write!(stream.write(DATA1));

stream.flush().unwrap();

Expand All @@ -105,7 +105,7 @@ where

assert_would_block(stream.read(&mut buf));

let bufs = [IoSlice::new(&DATA1), IoSlice::new(&DATA2)];
let bufs = [IoSlice::new(DATA1), IoSlice::new(DATA2)];
let n = stream
.write_vectored(&bufs)
.expect("unable to write vectored to stream");
Expand Down Expand Up @@ -277,7 +277,7 @@ fn shutdown_read() {
vec![ExpectEvent::new(ID1, Interest::WRITABLE)],
);

checked_write!(stream.write(&DATA2));
checked_write!(stream.write(DATA2));

expect_events(
&mut poll,
Expand Down Expand Up @@ -325,7 +325,7 @@ fn shutdown_write() {
vec![ExpectEvent::new(ID1, Interest::WRITABLE)],
);

checked_write!(stream.write(&DATA1));
checked_write!(stream.write(DATA1));

stream.shutdown(Shutdown::Write).unwrap();

Expand Down Expand Up @@ -365,7 +365,7 @@ fn shutdown_both() {
vec![ExpectEvent::new(ID1, Interest::WRITABLE)],
);

checked_write!(stream.write(&DATA1));
checked_write!(stream.write(DATA1));

expect_events(
&mut poll,
Expand Down Expand Up @@ -495,7 +495,7 @@ fn no_events_after_deregister() {
assert_would_block(stream.peek(&mut buf));
assert_would_block(stream.read(&mut buf));

checked_write!(stream.write(&DATA1));
checked_write!(stream.write(DATA1));
stream.flush().unwrap();

expect_no_events(&mut poll, &mut events);
Expand Down
14 changes: 7 additions & 7 deletions tests/unix_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ fn unix_stream_pair() {
let mut buf = [0; DEFAULT_BUF_SIZE];
assert_would_block(s1.read(&mut buf));

checked_write!(s1.write(&DATA1));
checked_write!(s1.write(DATA1));
s1.flush().unwrap();

expect_read!(s2.read(&mut buf), DATA1);
assert_would_block(s2.read(&mut buf));

checked_write!(s2.write(&DATA2));
checked_write!(s2.write(DATA2));
s2.flush().unwrap();

expect_read!(s1.read(&mut buf), DATA2);
Expand Down Expand Up @@ -163,7 +163,7 @@ fn unix_stream_shutdown_read() {
vec![ExpectEvent::new(TOKEN_1, Interest::WRITABLE)],
);

checked_write!(stream.write(&DATA1));
checked_write!(stream.write(DATA1));
expect_events(
&mut poll,
&mut events,
Expand Down Expand Up @@ -217,7 +217,7 @@ fn unix_stream_shutdown_write() {
vec![ExpectEvent::new(TOKEN_1, Interest::WRITABLE)],
);

checked_write!(stream.write(&DATA1));
checked_write!(stream.write(DATA1));
expect_events(
&mut poll,
&mut events,
Expand Down Expand Up @@ -272,7 +272,7 @@ fn unix_stream_shutdown_both() {
vec![ExpectEvent::new(TOKEN_1, Interest::WRITABLE)],
);

checked_write!(stream.write(&DATA1));
checked_write!(stream.write(DATA1));
expect_events(
&mut poll,
&mut events,
Expand Down Expand Up @@ -433,7 +433,7 @@ where
let mut buf = [0; DEFAULT_BUF_SIZE];
assert_would_block(stream.read(&mut buf));

checked_write!(stream.write(&DATA1));
checked_write!(stream.write(DATA1));
stream.flush().unwrap();
expect_events(
&mut poll,
Expand All @@ -445,7 +445,7 @@ where

assert!(stream.take_error().unwrap().is_none());

let bufs = [IoSlice::new(&DATA1), IoSlice::new(&DATA2)];
let bufs = [IoSlice::new(DATA1), IoSlice::new(DATA2)];
let wrote = stream.write_vectored(&bufs).unwrap();
assert_eq!(wrote, DATA1_LEN + DATA2_LEN);
expect_events(
Expand Down

0 comments on commit b48cce6

Please sign in to comment.