From f5ccd21f09e2ca5f26ff63a2d3815669064e36f0 Mon Sep 17 00:00:00 2001 From: Vika Date: Tue, 18 May 2021 18:50:13 +0300 Subject: Make rustfmt happy again after Clippy edits --- src/database/redis/mod.rs | 5 +---- src/frontend/mod.rs | 27 ++++++++++++++++++--------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/database/redis/mod.rs b/src/database/redis/mod.rs index cf94386..e64120f 100644 --- a/src/database/redis/mod.rs +++ b/src/database/redis/mod.rs @@ -167,10 +167,7 @@ impl Storage for RedisStorage { |post: Option| { post.map(|post| MicropubChannel { uid: post["properties"]["uid"][0].as_str().unwrap().to_string(), - name: post["properties"]["name"][0] - .as_str() - .unwrap() - .to_string(), + name: post["properties"]["name"][0].as_str().unwrap().to_string(), }) }, ) diff --git a/src/frontend/mod.rs b/src/frontend/mod.rs index 029c5dc..e3dad3f 100644 --- a/src/frontend/mod.rs +++ b/src/frontend/mod.rs @@ -688,11 +688,15 @@ pub async fn onboarding_receiver(mut req: Request(mut req: Request(_: Request>) -> Result { Err(FrontendError::with_code( StatusCode::ImATeapot, "Someone asked this website to brew them some coffee...", - ).into()) + ) + .into()) } pub async fn mainpage(req: Request>) -> Result { @@ -794,7 +800,7 @@ pub async fn mainpage(req: Request>) -> Result { ) .build()) } else { - return Err(feed_err.into()) + return Err(feed_err.into()); } } else { Ok(Response::builder(200) @@ -848,10 +854,13 @@ pub async fn render_post(req: Request>) -> Resul "h-entry" => templates::Entry { post: &post }.to_string(), "h-card" => templates::VCard { card: &post }.to_string(), "h-feed" => templates::Feed { feed: &post }.to_string(), - _ => return Err(FrontendError::with_code( - StatusCode::InternalServerError, - "Couldn't render an unknown type", - ).into()), + _ => { + return Err(FrontendError::with_code( + StatusCode::InternalServerError, + "Couldn't render an unknown type", + ) + .into()) + } }; Ok(Response::builder(200) -- cgit 1.4.1