Replace tempfile with tempdir

This commit is contained in:
Dustin J. Mitchell
2021-04-16 19:29:27 -04:00
parent 9c54985fac
commit c8d6619d71
9 changed files with 34 additions and 87 deletions

View File

@@ -164,11 +164,11 @@ impl<'t> StorageTxn for Txn<'t> {
#[cfg(test)]
mod test {
use super::*;
use tempdir::TempDir;
use tempfile::TempDir;
#[test]
fn test_get_client_empty() -> anyhow::Result<()> {
let tmp_dir = TempDir::new("test")?;
let tmp_dir = TempDir::new()?;
let storage = KvStorage::new(&tmp_dir.path())?;
let mut txn = storage.txn()?;
let maybe_client = txn.get_client(Uuid::new_v4())?;
@@ -178,7 +178,7 @@ mod test {
#[test]
fn test_client_storage() -> anyhow::Result<()> {
let tmp_dir = TempDir::new("test")?;
let tmp_dir = TempDir::new()?;
let storage = KvStorage::new(&tmp_dir.path())?;
let mut txn = storage.txn()?;
@@ -200,7 +200,7 @@ mod test {
#[test]
fn test_gvbp_empty() -> anyhow::Result<()> {
let tmp_dir = TempDir::new("test")?;
let tmp_dir = TempDir::new()?;
let storage = KvStorage::new(&tmp_dir.path())?;
let mut txn = storage.txn()?;
let maybe_version = txn.get_version_by_parent(Uuid::new_v4(), Uuid::new_v4())?;
@@ -210,7 +210,7 @@ mod test {
#[test]
fn test_add_version_and_gvbp() -> anyhow::Result<()> {
let tmp_dir = TempDir::new("test")?;
let tmp_dir = TempDir::new()?;
let storage = KvStorage::new(&tmp_dir.path())?;
let mut txn = storage.txn()?;