diff options
-rw-r--r-- | tokio/src/macros/select.rs | 7 | ||||
-rw-r--r-- | tokio/tests/tcp_into_split.rs | 2 | ||||
-rw-r--r-- | tokio/tests/tcp_split.rs | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/tokio/src/macros/select.rs b/tokio/src/macros/select.rs index 51b6fcd6..fc932bb9 100644 --- a/tokio/src/macros/select.rs +++ b/tokio/src/macros/select.rs @@ -359,8 +359,11 @@ macro_rules! select { let start = $crate::macros::support::thread_rng_n(BRANCHES); for i in 0..BRANCHES { - let branch = (start + i) % BRANCHES; - + let branch; + #[allow(clippy::modulo_one)] + { + branch = (start + i) % BRANCHES; + } match branch { $( $crate::count!( $($skip)* ) => { diff --git a/tokio/tests/tcp_into_split.rs b/tokio/tests/tcp_into_split.rs index 6561fa30..1c2af32e 100644 --- a/tokio/tests/tcp_into_split.rs +++ b/tokio/tests/tcp_into_split.rs @@ -94,7 +94,7 @@ async fn drop_write() -> Result<()> { let handle = thread::spawn(move || { let (mut stream, _) = listener.accept().unwrap(); - stream.write(MSG).unwrap(); + stream.write_all(MSG).unwrap(); let mut read_buf = [0u8; 32]; let res = match stream.read(&mut read_buf) { diff --git a/tokio/tests/tcp_split.rs b/tokio/tests/tcp_split.rs index 42f79770..7171dac4 100644 --- a/tokio/tests/tcp_split.rs +++ b/tokio/tests/tcp_split.rs @@ -17,7 +17,7 @@ async fn split() -> Result<()> { let handle = thread::spawn(move || { let (mut stream, _) = listener.accept().unwrap(); - stream.write(MSG).unwrap(); + stream.write_all(MSG).unwrap(); let mut read_buf = [0u8; 32]; let read_len = stream.read(&mut read_buf).unwrap(); |