From f90010e22a3d908782076d2ac8b3b586e976f85f Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Wed, 10 Jun 2020 15:07:40 +0100 Subject: [PATCH] [pack/unpack] fix bug in file_utils::file_size() --- src/file_utils.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/file_utils.rs b/src/file_utils.rs index 517f828..a63469d 100644 --- a/src/file_utils.rs +++ b/src/file_utils.rs @@ -41,8 +41,8 @@ pub fn fail(msg: &str) -> io::Result { } fn get_device_size(path: &str) -> io::Result { - let _file = File::open(path)?; - let fd = File::open(path).unwrap().as_raw_fd(); + let file = File::open(path)?; + let fd = file.as_raw_fd(); let mut cap = 0u64; unsafe { match ioctl_blkgetsize64(fd, &mut cap) {