about summary refs log tree commit diff
path: root/src/database/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/database/mod.rs')
-rw-r--r--src/database/mod.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/database/mod.rs b/src/database/mod.rs
index f48b4a9..c256867 100644
--- a/src/database/mod.rs
+++ b/src/database/mod.rs
@@ -215,6 +215,8 @@ pub type Result<T> = std::result::Result<T, StorageError>;
 /// or lock the database so that write conflicts or reading half-written data should not occur.
 #[async_trait]
 pub trait Storage: std::fmt::Debug + Clone + Send + Sync {
+    /// Initialize Self from a URL, possibly performing initialization.
+    async fn new(url: &'_ url::Url) -> Result<Self>;
     /// Return the list of categories used in blog posts of a specified blog.
     async fn categories(&self, url: &str) -> Result<Vec<String>>;
 
@@ -759,11 +761,9 @@ mod tests {
             #[tracing_test::traced_test]
             async fn $func_name() {
                 let tempdir = tempfile::tempdir().expect("Failed to create tempdir");
-                let backend = super::super::FileStorage::new(
-                    tempdir.path().to_path_buf()
-                )
-                    .await
-                    .unwrap();
+                let backend = super::super::FileStorage {
+                    root_dir: tempdir.path().to_path_buf()
+                };
                 super::$func_name(backend).await
             }
         };