1883: Clippy cleanup with the latest nightly. r=rtzoeller a=asomers



Co-authored-by: Alan Somers <asomers@gmail.com>
This commit is contained in:
bors[bot] 2022-11-25 17:14:59 +00:00 committed by GitHub
commit acd01d7634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 7 deletions

View File

@ -1727,6 +1727,8 @@ where
{
type Item = RecvMsg<'a, 'a, S>;
// The cast is not unnecessary on all platforms.
#[allow(clippy::unnecessary_cast)]
fn next(&mut self) -> Option<Self::Item> {
if self.current_index >= self.received {
return None;

View File

@ -1,5 +1,5 @@
use std::{
io::{Read, Seek, SeekFrom, Write},
io::{Read, Seek, Write},
ops::Deref,
os::unix::io::AsRawFd,
pin::Pin,
@ -371,7 +371,7 @@ mod aio_write {
assert_eq!(err, Ok(()));
assert_eq!(aiow.as_mut().aio_return().unwrap(), wbuf.len());
f.seek(SeekFrom::Start(0)).unwrap();
f.rewind().unwrap();
let len = f.read_to_end(&mut rbuf).unwrap();
assert_eq!(len, EXPECT.len());
assert_eq!(rbuf, EXPECT);
@ -402,7 +402,7 @@ mod aio_write {
assert_eq!(err, Ok(()));
assert_eq!(aiow.as_mut().aio_return().unwrap(), wbuf.len());
f.seek(SeekFrom::Start(0)).unwrap();
f.rewind().unwrap();
let len = f.read_to_end(&mut rbuf).unwrap();
assert_eq!(len, EXPECT.len());
assert_eq!(rbuf, EXPECT);
@ -487,7 +487,7 @@ mod aio_writev {
assert_eq!(err, Ok(()));
assert_eq!(aiow.as_mut().aio_return().unwrap(), wlen);
f.seek(SeekFrom::Start(0)).unwrap();
f.rewind().unwrap();
let len = f.read_to_end(&mut rbuf).unwrap();
assert_eq!(len, EXPECT.len());
assert_eq!(rbuf, EXPECT);
@ -537,7 +537,7 @@ fn sigev_signal() {
}
assert_eq!(aiow.as_mut().aio_return().unwrap(), WBUF.len());
f.seek(SeekFrom::Start(0)).unwrap();
f.rewind().unwrap();
let len = f.read_to_end(&mut rbuf).unwrap();
assert_eq!(len, EXPECT.len());
assert_eq!(rbuf, EXPECT);

View File

@ -231,7 +231,7 @@ fn test_readlink() {
mod linux_android {
use libc::loff_t;
use std::io::prelude::*;
use std::io::{IoSlice, SeekFrom};
use std::io::IoSlice;
use std::os::unix::prelude::*;
use nix::fcntl::*;
@ -272,7 +272,7 @@ mod linux_android {
.unwrap();
let mut res: String = String::new();
tmp2.seek(SeekFrom::Start(0)).unwrap();
tmp2.rewind().unwrap();
tmp2.read_to_string(&mut res).unwrap();
assert_eq!(res, String::from("bar"));