diff --git a/src/sys/flock/mod.rs b/src/sys/flock/mod.rs index 8252a97..ab48410 100644 --- a/src/sys/flock/mod.rs +++ b/src/sys/flock/mod.rs @@ -13,8 +13,8 @@ cfg_if! { cfg_if! { if #[cfg(unix)] { - mod flock; - pub use self::flock::*; + mod unix; + pub use self::unix::*; } } diff --git a/src/sys/flock/flock.rs b/src/sys/flock/unix.rs similarity index 100% rename from src/sys/flock/flock.rs rename to src/sys/flock/unix.rs diff --git a/tests/simple_tests.rs b/tests/simple_tests.rs index 98cfb29..61bc930 100644 --- a/tests/simple_tests.rs +++ b/tests/simple_tests.rs @@ -77,11 +77,12 @@ fn handle_relative_walk_entries_hashset(handle: &Handle) -> HashSet { .expect("should be able to walk handle dir") .into_iter() .map(|mut entry: WalkEntry| { - entry.path = entry + let suffix = entry .path .strip_prefix(handle.dir()) .expect("walk entry should have handle dir path prefix") .to_owned(); + suffix.clone_into(&mut entry.path); entry }) .collect() @@ -525,6 +526,8 @@ fn test_writeback_mmap() -> anyhow::Result<()> { let mut file = OpenOptions::new() .write(true) .create(true) + // Don't truncate because we're about to it anyway. + .truncate(false) .open("writeback")?; file.set_len(0x1000)?; let read_file = OpenOptions::new().read(true).open("writeback")?;