about summary refs log tree commit diff
path: root/src/micropub
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2024-08-01 19:48:37 +0300
committerVika <vika@fireburn.ru>2024-08-01 20:40:00 +0300
commit7e8e688e2e58f9c944b941e768ab7b034a348a1f (patch)
tree1068469c6b9b97bac407038276fd8971b2101e48 /src/micropub
parent57a9c3c7e520714928904fc7e2ff3d62ac2b2467 (diff)
downloadkittybox-7e8e688e2e58f9c944b941e768ab7b034a348a1f.tar.zst
treewide: create a common method for state initialization
Now the database objects can be uniformly created from a URI. They can
also optionally do sanity checks and one-time initialization.
Diffstat (limited to 'src/micropub')
-rw-r--r--src/micropub/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/micropub/mod.rs b/src/micropub/mod.rs
index 74f53a0..624c239 100644
--- a/src/micropub/mod.rs
+++ b/src/micropub/mod.rs
@@ -760,7 +760,7 @@ mod tests {
 
     #[tokio::test]
     async fn test_post_reject_scope() {
-        let db = crate::database::MemoryStorage::new();
+        let db = crate::database::MemoryStorage::default();
 
         let post = json!({
             "type": ["h-entry"],
@@ -788,7 +788,7 @@ mod tests {
 
     #[tokio::test]
     async fn test_post_reject_different_user() {
-        let db = crate::database::MemoryStorage::new();
+        let db = crate::database::MemoryStorage::default();
 
         let post = json!({
             "type": ["h-entry"],
@@ -818,7 +818,7 @@ mod tests {
 
     #[tokio::test]
     async fn test_post_mf2() {
-        let db = crate::database::MemoryStorage::new();
+        let db = crate::database::MemoryStorage::default();
 
         let post = json!({
             "type": ["h-entry"],
@@ -850,7 +850,7 @@ mod tests {
     #[tokio::test]
     async fn test_query_foreign_url() {
         let mut res = super::query(
-            axum::Extension(crate::database::MemoryStorage::new()),
+            axum::Extension(crate::database::MemoryStorage::default()),
             Some(axum::extract::Query(super::MicropubQuery::source(
                 "https://aaronparecki.com/feeds/main",
             ))),