From d178e35c34a9106dd6c0a86286ff56dc8b297942 Mon Sep 17 00:00:00 2001 From: Vika Date: Mon, 17 May 2021 18:52:12 +0300 Subject: Make clippy happy --- src/database/redis/mod.rs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/database/redis') diff --git a/src/database/redis/mod.rs b/src/database/redis/mod.rs index 5a6b70d..cf94386 100644 --- a/src/database/redis/mod.rs +++ b/src/database/redis/mod.rs @@ -165,17 +165,13 @@ impl Storage for RedisStorage { .map(|channel| { self.get_post(channel).map(|result| result.unwrap()).map( |post: Option| { - if let Some(post) = post { - Some(MicropubChannel { - uid: post["properties"]["uid"][0].as_str().unwrap().to_string(), - name: post["properties"]["name"][0] - .as_str() - .unwrap() - .to_string(), - }) - } else { - None - } + post.map(|post| MicropubChannel { + uid: post["properties"]["uid"][0].as_str().unwrap().to_string(), + name: post["properties"]["name"][0] + .as_str() + .unwrap() + .to_string(), + }) }, ) }) @@ -183,7 +179,7 @@ impl Storage for RedisStorage { ) .await .into_iter() - .filter_map(|chan| chan) + .flatten() .collect::>()) } -- cgit 1.4.1