diff --git a/apb/src/lib.rs b/apb/src/lib.rs index b976e93..6bacda5 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 bc29122..2d05f3e 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()), - ); - } - } -}