From 0ee2072d40dc0b88a7f475a25dfc790d49546a5f Mon Sep 17 00:00:00 2001 From: Vika Date: Sun, 10 Jul 2022 14:55:18 +0300 Subject: database: use .path().to_path_buf() to prevent dropping the tempdir I'm afraid this might've caused me to do some weird stuff with the tempdir. Better do it like this. --- kittybox-rs/src/database/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'kittybox-rs/src/database/mod.rs') diff --git a/kittybox-rs/src/database/mod.rs b/kittybox-rs/src/database/mod.rs index bd25d8d..10fbc72 100644 --- a/kittybox-rs/src/database/mod.rs +++ b/kittybox-rs/src/database/mod.rs @@ -547,7 +547,9 @@ mod tests { async fn $func_name() { test_logger::ensure_env_logger_initialized(); let tempdir = tempdir::TempDir::new("file").expect("Failed to create tempdir"); - let backend = super::super::FileStorage::new(tempdir.into_path()) + let backend = super::super::FileStorage::new( + tempdir.path().to_path_buf() + ) .await .unwrap(); super::$func_name(backend).await -- cgit 1.4.1