]> Untitled Git - lemmy.git/blobdiff - crates/api/src/local_user.rs
Fix API and clippy warnings
[lemmy.git] / crates / api / src / local_user.rs
index aacb7d0bf36a1b90d469db9741c1b7e7006298b4..ff28341b39bd614a093f2fbd02ea29ac508ba263 100644 (file)
@@ -153,7 +153,7 @@ impl Perform for GetCaptcha {
     context.chat_server().do_send(captcha_item);
 
     Ok(GetCaptchaResponse {
-      ok: Some(CaptchaResponse { png, uuid, wav }),
+      ok: Some(CaptchaResponse { png, wav, uuid }),
     })
   }
 }
@@ -407,10 +407,7 @@ impl Perform for BanPerson {
     }
 
     // Mod tables
-    let expires = match data.expires {
-      Some(time) => Some(naive_from_unix(time)),
-      None => None,
-    };
+    let expires = data.expires.map(naive_from_unix);
 
     let form = ModBanForm {
       mod_person_id: local_user_view.person.id,