chore(apb): into_inner -> into_value

This commit is contained in:
əlemi 2024-11-19 14:19:25 +01:00
parent cfff8fb053
commit f82e624fd9
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 3 additions and 3 deletions

View file

@ -311,7 +311,7 @@ pub fn set_maybe_node(obj: &mut serde_json::Value, key: &str, node: crate::Node<
if node.is_empty() { if node.is_empty() {
set_maybe_value(obj, key, None) set_maybe_value(obj, key, None)
} else { } else {
set_maybe_value(obj, key, Some(node.into_inner())) set_maybe_value(obj, key, Some(node.into_value()))
} }
} }

View file

@ -121,7 +121,7 @@ impl<T : super::Base> Node<T> {
#[cfg(feature = "unstructured")] #[cfg(feature = "unstructured")]
impl Node<serde_json::Value> { impl Node<serde_json::Value> {
pub fn into_inner(self) -> serde_json::Value { pub fn into_value(self) -> serde_json::Value {
match self { match self {
Self::Object(x) => *x, Self::Object(x) => *x,
Self::Link(l) => serde_json::Value::String(l.href().unwrap_or_default().to_string()), Self::Link(l) => serde_json::Value::String(l.href().unwrap_or_default().to_string()),
@ -129,7 +129,7 @@ impl Node<serde_json::Value> {
Self::Array(arr) => serde_json::Value::Array( Self::Array(arr) => serde_json::Value::Array(
arr arr
.into_iter() .into_iter()
.map(|x| x.into_inner()) .map(|x| x.into_value())
.collect() .collect()
), ),
} }