]> Untitled Git - lemmy.git/blobdiff - crates/api/src/community.rs
Fix API and clippy warnings
[lemmy.git] / crates / api / src / community.rs
index 1ee2a9a76ae15d3702c93938872d353c8a8b8bc5..f1cf570c05a675a2a0ed4990a6b154c874c2a32b 100644 (file)
@@ -188,10 +188,7 @@ impl Perform for BanFromCommunity {
 
     // Mod tables
     // TODO eventually do correct expires
-    let expires = match data.expires {
-      Some(time) => Some(naive_from_unix(time)),
-      None => None,
-    };
+    let expires = data.expires.map(naive_from_unix);
 
     let form = ModBanFromCommunityForm {
       mod_person_id: local_user_view.person.id,