diff options
author | Vika <vika@fireburn.ru> | 2021-05-17 18:52:12 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2021-05-17 18:52:12 +0300 |
commit | d178e35c34a9106dd6c0a86286ff56dc8b297942 (patch) | |
tree | db99416312044e76a7678d836dc635bf0cf888b1 /src/database/redis/mod.rs | |
parent | 9a2791d745f4a9f0307eb69b50de5629f51564cc (diff) | |
download | kittybox-d178e35c34a9106dd6c0a86286ff56dc8b297942.tar.zst |
Make clippy happy
Diffstat (limited to 'src/database/redis/mod.rs')
-rw-r--r-- | src/database/redis/mod.rs | 20 |
1 files changed, 8 insertions, 12 deletions
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<serde_json::Value>| { - 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::<Vec<_>>()) } |