chore: fix clippy errors (#2571)

This commit is contained in:
Mikail Bagishov
2020-05-30 14:06:03 -07:00
committed by GitHub
parent f2f30d4cf6
commit db0d6d75b3
3 changed files with 7 additions and 4 deletions
+5 -2
View File
@@ -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)* ) => {
+1 -1
View File
@@ -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) {
+1 -1
View File
@@ -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();