about summary refs log tree commit diff
path: root/src/micropub
diff options
context:
space:
mode:
Diffstat (limited to 'src/micropub')
-rw-r--r--src/micropub/post.rs20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/micropub/post.rs b/src/micropub/post.rs
index def518a..070c822 100644
--- a/src/micropub/post.rs
+++ b/src/micropub/post.rs
@@ -133,17 +133,17 @@ pub fn normalize_mf2(mut body: serde_json::Value, user: &User) -> (String, serde
                 let default_channel = me.join(DEFAULT_CHANNEL_PATH).unwrap().to_string();
 
                 body["properties"]["channel"] = json!([default_channel]);
-            },
+            }
             Some("h-card") => {
                 let default_channel = me.join(CONTACTS_CHANNEL_PATH).unwrap().to_string();
 
                 body["properties"]["channel"] = json!([default_channel]);
-            },
+            }
             Some("h-food") => {
                 let default_channel = me.join(FOOD_CHANNEL_PATH).unwrap().to_string();
 
                 body["properties"]["channel"] = json!([default_channel]);
-            },
+            }
             // TODO h-event
             /*"h-event" => {
                 let default_channel
@@ -239,14 +239,7 @@ pub async fn new_post<S: Storage>(
             Ok(exists) => {
                 if exists {
                     if let Err(err) = storage
-                        .update_post(
-                            &channel,
-                            json!({
-                                "add": {
-                                    "children": [uid]
-                                }
-                            }),
-                        )
+                        .update_post(&channel, json!({"add": {"children": [uid]}}))
                         .await
                     {
                         return error_json!(
@@ -258,7 +251,10 @@ pub async fn new_post<S: Storage>(
                             )
                         );
                     }
-                } else if channel == default_channel || channel == vcards_channel || channel == food_channel {
+                } else if channel == default_channel
+                    || channel == vcards_channel
+                    || channel == food_channel
+                {
                     if let Err(err) = create_feed(storage, &uid, &channel, &user).await {
                         return error_json!(
                             500,