From 7d5852efdd8e67a69959970219b2fa287ccfff86 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Tue, 26 Sep 2023 21:55:28 +0200 Subject: [PATCH] Return empty value if nothing is found. --- src/main.rs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/main.rs b/src/main.rs index e526137..45cff86 100644 --- a/src/main.rs +++ b/src/main.rs @@ -173,18 +173,7 @@ async fn get_progress( .unwrap_or_default(); if values.is_empty() { - let res = GetProgress { - percentage: 0.0f32, - progress: String::new(), - device: String::new(), - device_id: String::new(), - timestamp: 0, - document, - }; - return ( - StatusCode::OK, - Json(json!({})), - ); + return (StatusCode::OK, Json(json!({}))); } let res = GetProgress {