Add separate case for empty result

This commit is contained in:
Dominik Werder
2025-02-25 11:33:31 +01:00
parent 9aeb6ecf2f
commit fb155eb6ac
3 changed files with 36 additions and 26 deletions

View File

@@ -342,12 +342,12 @@ pub async fn timebinned_json(
let collected: BoxFuture<_> = Box::pin(collected);
let collres = collected.await?;
match collres {
CollectResult::Some(collres) => {
let x = collres.into_user_facing_api_type_box();
let val = x.into_serializable_json();
CollectResult::Some(res) => {
let val = res.into_user_facing_api_type_box().into_serializable_json();
let jsval = serde_json::to_string(&val)?;
Ok(CollectResult::Some(JsonBytes::new(jsval)))
}
CollectResult::Empty => Ok(CollectResult::Empty),
CollectResult::Timeout => Ok(CollectResult::Timeout),
}
}