From 5c6f1c818adfa59921ac3ef61ed6b61c6eb44791 Mon Sep 17 00:00:00 2001 From: naskya Date: Mon, 22 Apr 2024 00:21:10 +0900 Subject: [PATCH] chore (backend-rs): clean redundant match expression --- packages/backend-rs/src/service/stream.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/backend-rs/src/service/stream.rs b/packages/backend-rs/src/service/stream.rs index 8ca79cd96c..700a834c83 100644 --- a/packages/backend-rs/src/service/stream.rs +++ b/packages/backend-rs/src/service/stream.rs @@ -51,10 +51,7 @@ pub fn publish_to_stream( format!( "{{ \"type\": \"{}\", \"body\": {} }}", kind, - match value { - Some(v) => v, - None => "null".to_string(), - } + value.unwrap_or("null".to_string()), ) } else { value.ok_or(Error::ValueError("Invalid streaming message".to_string()))?