]> Untitled Git - lemmy.git/blobdiff - crates/api_crud/src/community/read.rs
Fix API and clippy warnings
[lemmy.git] / crates / api_crud / src / community / read.rs
index af83a7749b5c0c048dad33622d9c17444d65d632..08982aa15b64573e04beffeaab7f16a7f2316b87 100644 (file)
@@ -87,10 +87,7 @@ impl PerformCrud for ListCommunities {
     let data: &ListCommunities = &self;
     let local_user_view = get_local_user_view_from_jwt_opt(&data.auth, context.pool()).await?;
 
-    let person_id = match &local_user_view {
-      Some(uv) => Some(uv.person.id),
-      None => None,
-    };
+    let person_id = local_user_view.to_owned().map(|l| l.person.id);
 
     // Don't show NSFW by default
     let show_nsfw = match &local_user_view {