avoid compiler warnings

This commit is contained in:
Dietmar Maurer
2019-06-03 06:43:47 +02:00
parent 36898ffce6
commit 1c0472e88f
3 changed files with 5 additions and 7 deletions

View File

@ -211,7 +211,6 @@ pub fn file_set_contents_full<P: AsRef<Path>>(
}
}
use std::os::unix::io::FromRawFd;
let mut file = unsafe { File::from_raw_fd(fd) };
if let Err(err) = file.write_all(data) {
@ -765,7 +764,6 @@ nix::ioctl_read!(blkgetsize64, 0x12, 114, u64);
/// Return file or block device size
pub fn image_size(path: &Path) -> Result<u64, Error> {
use std::os::unix::io::AsRawFd;
use std::os::unix::fs::FileTypeExt;
let file = std::fs::File::open(path)?;