Follow clippy

This commit is contained in:
Kitaiti Makoto 2022-05-03 10:53:16 +09:00
parent 1f62bf27f8
commit b04edfa05e

View File

@ -884,9 +884,7 @@ impl FromId<DbConn> for PostUpdate {
.content() .content()
.and_then(|content| content.to_as_string()), .and_then(|content| content.to_as_string()),
cover: None, cover: None,
source: updated source: updated.source().and_then(|s| {
.source()
.and_then(|s| {
serde_json::to_value(s).ok().and_then(|obj| { serde_json::to_value(s).ok().and_then(|obj| {
if !obj.is_object() { if !obj.is_object() {
return None; return None;
@ -894,8 +892,7 @@ impl FromId<DbConn> for PostUpdate {
obj.get("content") obj.get("content")
.and_then(|content| content.as_str().map(|c| c.to_string())) .and_then(|content| content.as_str().map(|c| c.to_string()))
}) })
}) }),
.map(|s| s.to_string()),
license: None, license: None,
tags: updated tags: updated
.tag() .tag()