From eddde7c8b90de7cfb9a582a71ed91ee8b60b9648 Mon Sep 17 00:00:00 2001 From: alemi Date: Sun, 19 May 2024 21:18:58 +0200 Subject: [PATCH] fix(apb): setting href always succeeds --- apb/src/types/link.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apb/src/types/link.rs b/apb/src/types/link.rs index 2a7921f..774be39 100644 --- a/apb/src/types/link.rs +++ b/apb/src/types/link.rs @@ -65,17 +65,15 @@ impl Link for serde_json::Value { #[cfg(feature = "unstructured")] impl LinkMut for serde_json::Value { - // TODO this can fail, but it should never do! fn set_href(mut self, href: &str) -> Self { match &mut self { - serde_json::Value::String(x) => *x = href.to_string(), serde_json::Value::Object(map) => { map.insert( "href".to_string(), serde_json::Value::String(href.to_string()) ); }, - _ => tracing::error!("failed setting href on invalid json Link object"), + x => *x = serde_json::Value::String(href.to_string()), } self }