about summary refs log tree commit diff
path: root/src/frontend/mod.rs
diff options
context:
space:
mode:
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