From c02037628e36e71e528b3c76ffb88dc103d73228 Mon Sep 17 00:00:00 2001 From: Vika Date: Mon, 6 Dec 2021 20:49:58 +0300 Subject: Make rustfmt and clippy happy --- src/micropub/get.rs | 4 ++-- src/micropub/post.rs | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src/micropub') diff --git a/src/micropub/get.rs b/src/micropub/get.rs index 9732281..718714a 100644 --- a/src/micropub/get.rs +++ b/src/micropub/get.rs @@ -24,7 +24,7 @@ where match &*query.q { "config" => { let channels: Vec; - match backend.get_channels(&user.me.as_str()).await { + match backend.get_channels(user.me.as_str()).await { Ok(chans) => channels = chans, Err(err) => return Ok(err.into()) } @@ -36,7 +36,7 @@ where }, "channel" => { let channels: Vec; - match backend.get_channels(&user.me.as_str()).await { + match backend.get_channels(user.me.as_str()).await { Ok(chans) => channels = chans, Err(err) => return Ok(err.into()) } diff --git a/src/micropub/post.rs b/src/micropub/post.rs index c465a6f..de2b162 100644 --- a/src/micropub/post.rs +++ b/src/micropub/post.rs @@ -255,7 +255,7 @@ pub async fn new_post( || channel == vcards_channel || channel == food_channel { - if let Err(err) = create_feed(storage, &uid, &channel, &user).await { + if let Err(err) = create_feed(storage, &uid, &channel, user).await { return error_json!( 500, "database_error", @@ -313,7 +313,7 @@ async fn create_feed( }, "children": [uid] }), - &user, + user, ); storage.put_post(&feed, user.me.as_str()).await } @@ -483,8 +483,9 @@ async fn post_process_new_post( // TODO: Replace this function once the MF2 parser is ready // A compliant parser's output format includes rels, // we could just find a Webmention one in there - let pattern = easy_scraper::Pattern::new(r#""#) - .expect("Pattern for webmentions couldn't be parsed"); + let pattern = + easy_scraper::Pattern::new(r#""#) + .expect("Pattern for webmentions couldn't be parsed"); let matches = pattern.matches(&body); if matches.is_empty() { return None; @@ -580,7 +581,7 @@ async fn process_json( "You're not allowed to delete someone else's posts." ); } - if let Err(error) = req.state().storage.delete_post(&url).await { + if let Err(error) = req.state().storage.delete_post(url).await { return Ok(error.into()); } Ok(Response::builder(200).build()) @@ -602,7 +603,7 @@ async fn process_json( "You're not allowed to delete someone else's posts." ); } - if let Err(error) = req.state().storage.update_post(&url, body.clone()).await { + if let Err(error) = req.state().storage.update_post(url, body.clone()).await { Ok(error.into()) } else { Ok(Response::builder(204).build()) @@ -679,7 +680,7 @@ async fn process_form( "You're not allowed to delete someone else's posts." ); } - if let Err(error) = req.state().storage.delete_post(&url).await { + if let Err(error) = req.state().storage.delete_post(url).await { return error_json!(500, "database_error", error); } return Ok(Response::builder(200).build()); -- cgit 1.4.1