about summary refs log tree commit diff
path: root/src/frontend/mod.rs
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2021-12-06 20:49:58 +0300
committerVika <vika@fireburn.ru>2021-12-06 21:00:02 +0300
commitc02037628e36e71e528b3c76ffb88dc103d73228 (patch)
treee0d78a61af2f6e1ca7effcca1722f0da31293c05 /src/frontend/mod.rs
parent9a9776230ce8d12d305ca8db19cc76f20ae40926 (diff)
Make rustfmt and clippy happy
Diffstat (limited to 'src/frontend/mod.rs')
-rw-r--r--src/frontend/mod.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/frontend/mod.rs b/src/frontend/mod.rs
index 76114c5..c0452f3 100644
--- a/src/frontend/mod.rs
+++ b/src/frontend/mod.rs
@@ -33,11 +33,14 @@ struct FrontendError {
     code: StatusCode,
 }
 impl FrontendError {
-    pub fn with_code<C>(code: C, msg: &str) -> Self where C: TryInto<StatusCode> {
+    pub fn with_code<C>(code: C, msg: &str) -> Self
+    where
+        C: TryInto<StatusCode>,
+    {
         Self {
             msg: msg.to_string(),
             source: None,
-            code: code.try_into().unwrap_or_else(|_| StatusCode::InternalServerError),
+            code: code.try_into().unwrap_or(StatusCode::InternalServerError),
         }
     }
     pub fn msg(&self) -> &str {
@@ -188,7 +191,7 @@ pub async fn onboarding_receiver<S: Storage>(mut req: Request<ApplicationState<S
 
     log::debug!("Creating feeds...");
     for feed in body.feeds {
-        if &feed.name == "" || &feed.slug == "" {
+        if feed.name.is_empty() || feed.slug.is_empty() {
             continue;
         };
         log::debug!("Creating feed {} with slug {}", &feed.name, &feed.slug);
@@ -408,7 +411,7 @@ where
     ) -> Result {
         let authorization_endpoint = request.state().authorization_endpoint.to_string();
         let token_endpoint = request.state().token_endpoint.to_string();
-        let owner = request.url().origin().ascii_serialization().clone() + "/";
+        let owner = request.url().origin().ascii_serialization() + "/";
         let site_name = &request
             .state()
             .storage