chore: concat two statements

This commit is contained in:
naskya 2024-05-27 02:31:14 +09:00 committed by Eana Hufwe
parent 6c449466a5
commit 3a62097ec3

View file

@ -136,12 +136,11 @@ async fn encode_mastodon_payload(
// Ice Cubes and Mammoth expect notification_id to be an integer, but never use it. // Ice Cubes and Mammoth expect notification_id to be an integer, but never use it.
if client.name == "IceCubesApp" || client.name == "Mammoth" { if client.name == "IceCubesApp" || client.name == "Mammoth" {
let notification_id = object let timestamp = object
.get("notification_id") .get("notification_id")
.and_then(|id| id.as_str()) .and_then(|id| id.as_str())
.unwrap_or("0"); .map(|id| get_timestamp(id).unwrap_or_default())
.unwrap_or_default();
let timestamp = get_timestamp(notification_id).unwrap_or(0);
object.insert("notification_id".to_string(), timestamp.into()); object.insert("notification_id".to_string(), timestamp.into());
} }