From 8712b5e7233a07d91092dbeeb92c1ae24d7eddff Mon Sep 17 00:00:00 2001 From: alemi Date: Mon, 27 May 2024 16:53:48 +0200 Subject: [PATCH] fix(apb): export profile, remove dead code --- apb/src/lib.rs | 2 +- apb/src/macros.rs | 46 ---------------------------------------------- 2 files changed, 1 insertion(+), 47 deletions(-) diff --git a/apb/src/lib.rs b/apb/src/lib.rs index b976e93d..6bacda54 100644 --- a/apb/src/lib.rs +++ b/apb/src/lib.rs @@ -120,7 +120,7 @@ pub use types::{ }, document::{Document, DocumentMut, DocumentType}, place::{Place, PlaceMut}, - // profile::Profile, + profile::Profile, relationship::{Relationship, RelationshipMut}, tombstone::{Tombstone, TombstoneMut}, }, diff --git a/apb/src/macros.rs b/apb/src/macros.rs index bc291227..2d05f3e2 100644 --- a/apb/src/macros.rs +++ b/apb/src/macros.rs @@ -357,49 +357,3 @@ pub fn set_maybe_value(obj: &mut serde_json::Value, key: &str, value: Option); - fn insert_str(&mut self, k: &str, v: Option<&str>); - fn insert_float(&mut self, k: &str, f: Option); - fn insert_timestr(&mut self, k: &str, t: Option>); -} - -#[cfg(feature = "unstructured")] -impl InsertValue for serde_json::Map { - fn insert_node(&mut self, k: &str, node: crate::Node) { - if !node.is_nothing() { - self.insert(k.to_string(), node.into()); - } - } - - fn insert_str(&mut self, k: &str, v: Option<&str>) { - if let Some(v) = v { - self.insert( - k.to_string(), - serde_json::Value::String(v.to_string()), - ); - } - } - - fn insert_float(&mut self, k: &str, v: Option) { - if let Some(v) = v { - if let Some(n) = serde_json::Number::from_f64(v) { - self.insert( - k.to_string(), - serde_json::Value::Number(n), - ); - } - } - } - - fn insert_timestr(&mut self, k: &str, t: Option>) { - if let Some(published) = t { - self.insert( - k.to_string(), - serde_json::Value::String(published.to_rfc3339()), - ); - } - } -}