about summary refs log tree commit diff
path: root/src/frontend
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2025-04-09 23:06:25 +0300
committerVika <vika@fireburn.ru>2025-04-09 23:31:57 +0300
commitfa6e3fef17de18f80b5148b443d5f79f35d2dde2 (patch)
tree30d71a5fc640f4e5e24b57e6a78956feeb02d4d9 /src/frontend
parent6f47cd5b5ed220f3fcfe6566166f774ccd26d0c3 (diff)
downloadkittybox-fa6e3fef17de18f80b5148b443d5f79f35d2dde2.tar.zst
Replace tuple from `normalize_mf2` with `NormalizedPost` struct
This is a little bit more idiomatic.

Perhaps I should consider doing the same with other tuples I return?

Change-Id: I85f0e5dc76b8212ab6d192376d8c38ce2048ae85
Diffstat (limited to 'src/frontend')
-rw-r--r--src/frontend/onboarding.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/frontend/onboarding.rs b/src/frontend/onboarding.rs
index 4588157..bf313cf 100644
--- a/src/frontend/onboarding.rs
+++ b/src/frontend/onboarding.rs
@@ -84,7 +84,7 @@ async fn onboard<D: Storage + 'static>(
         .await
         .map_err(FrontendError::from)?;
 
-    let (_, hcard) = {
+    let crate::micropub::util::NormalizedPost { id: _, post: hcard } = {
         let mut hcard = data.user;
         hcard["properties"]["uid"] = serde_json::json!([&user_uid]);
         crate::micropub::normalize_mf2(hcard, &user)
@@ -99,7 +99,7 @@ async fn onboard<D: Storage + 'static>(
             continue;
         };
         debug!("Creating feed {} with slug {}", &feed.name, &feed.slug);
-        let (_, feed) = crate::micropub::normalize_mf2(
+        let crate::micropub::util::NormalizedPost { id: _, post: feed } = crate::micropub::normalize_mf2(
             serde_json::json!({
                 "type": ["h-feed"],
                 "properties": {"name": [feed.name], "mp-slug": [feed.slug]}
@@ -111,7 +111,7 @@ async fn onboard<D: Storage + 'static>(
             .await
             .map_err(FrontendError::from)?;
     }
-    let (uid, post) = crate::micropub::normalize_mf2(data.first_post, &user);
+    let crate::micropub::util::NormalizedPost { id: uid, post } = crate::micropub::normalize_mf2(data.first_post, &user);
     tracing::debug!("Posting first post {}...", uid);
     crate::micropub::_post(&user, uid, post, db, http, jobset)
         .await