Skip to content

Commit 2a687a9

Browse files
committed
fix(test): move import to where its needed
The usesite of this import was behind a cfg, so some feature combos printed a warning about unused imports. Signed-off-by: Patrick Roy <[email protected]>
1 parent 48bc548 commit 2a687a9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/mmap/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,6 @@ mod tests {
493493
use crate::GuestAddressSpace;
494494

495495
use std::io::Write;
496-
use std::mem;
497496
#[cfg(feature = "rawfd")]
498497
use std::{fs::File, path::Path};
499498
use vmm_sys_util::tempfile::TempFile;
@@ -942,7 +941,7 @@ mod tests {
942941
format!("{:?}", gm.write_obj(val1, bad_addr2).err().unwrap()),
943942
format!(
944943
"PartialBuffer {{ expected: {:?}, completed: {:?} }}",
945-
mem::size_of::<u64>(),
944+
std::mem::size_of::<u64>(),
946945
max_addr.checked_offset_from(bad_addr2).unwrap()
947946
)
948947
);
@@ -991,6 +990,8 @@ mod tests {
991990
#[test]
992991
#[cfg(feature = "rawfd")]
993992
fn read_to_and_write_from_mem() {
993+
use std::mem;
994+
994995
let f = TempFile::new().unwrap().into_file();
995996
f.set_len(0x400).unwrap();
996997

0 commit comments

Comments
 (0)