浏览代码

Minor change

Cesar Rodas 3 月之前
父节点
当前提交
6aff308dd5
共有 1 个文件被更改,包括 11 次插入8 次删除
  1. 11 8
      crates/storage/rocksdb/src/lib.rs

+ 11 - 8
crates/storage/rocksdb/src/lib.rs

@@ -293,13 +293,16 @@ impl Storage for RocksDb {
 }
 
 #[cfg(test)]
-async fn new_instance(path: &str) -> RocksDb {
-    RocksDb::new(path).expect("valid db")
-}
+mod test {
+    use super::*;
 
-#[cfg(test)]
-async fn destroy_instance(path: &str) {
-    std::fs::remove_dir_all(path).expect("deleted file");
-}
+    async fn new_instance(path: &str) -> RocksDb {
+        RocksDb::new(path).expect("valid db")
+    }
 
-nostr_rs_storage_base::storage_test!(RocksDb, new_instance, destroy_instance);
+    async fn destroy_instance(path: &str) {
+        std::fs::remove_dir_all(path).expect("deleted file");
+    }
+
+    nostr_rs_storage_base::storage_test!(RocksDb, new_instance, destroy_instance);
+}