diff --git a/test/sys/test_aio.rs b/test/sys/test_aio.rs index 6a36f3e7cf..a4fb9a535b 100644 --- a/test/sys/test_aio.rs +++ b/test/sys/test_aio.rs @@ -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); @@ -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); diff --git a/test/test_fcntl.rs b/test/test_fcntl.rs index 345e04daa5..e51044a069 100644 --- a/test/test_fcntl.rs +++ b/test/test_fcntl.rs @@ -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"));