chore: fix clippy errors (#2571)

This commit is contained in:
Mikail Bagishov 2020-05-31 00:06:03 +03:00 committed by GitHub
parent f2f30d4cf6
commit db0d6d75b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

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)* ) => {

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) {

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();