mirror of
https://gitee.com/openharmony/third_party_rust_nix
synced 2024-11-23 07:20:09 +00:00
Merge #1883
1883: Clippy cleanup with the latest nightly. r=rtzoeller a=asomers Co-authored-by: Alan Somers <asomers@gmail.com>
This commit is contained in:
commit
acd01d7634
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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"));
|
||||
|
Loading…
Reference in New Issue
Block a user