diff --git a/bucket_map/src/bucket_storage.rs b/bucket_map/src/bucket_storage.rs index 05463387b6..dac4e9b11c 100644 --- a/bucket_map/src/bucket_storage.rs +++ b/bucket_map/src/bucket_storage.rs @@ -381,16 +381,12 @@ impl BucketStorage { #[cfg(test)] mod test { - use super::*; + use {super::*, tempfile::tempdir}; #[test] fn test_bucket_storage() { - let tmpdir1 = std::env::temp_dir().join("bucket_map_test_mt"); - let paths: Vec = [tmpdir1] - .iter() - .filter(|x| std::fs::create_dir_all(x).is_ok()) - .cloned() - .collect(); + let tmpdir = tempdir().unwrap(); + let paths: Vec = vec![tmpdir.path().to_path_buf()]; assert!(!paths.is_empty()); let mut storage =