fix(apb): is_nothing -> is_empty

This commit is contained in:
əlemi 2024-11-11 01:19:51 +01:00
parent 4b632faf2a
commit cfff8fb053
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 2 additions and 8 deletions

View file

@ -308,7 +308,7 @@ pub(crate) use setter;
#[cfg(feature = "unstructured")]
pub fn set_maybe_node(obj: &mut serde_json::Value, key: &str, node: crate::Node<serde_json::Value>) {
if node.is_nothing() {
if node.is_empty() {
set_maybe_value(obj, key, None)
} else {
set_maybe_value(obj, key, Some(node.into_inner()))

View file

@ -61,7 +61,7 @@ impl<T : super::Base> Node<T> {
}
/// true only if Node is empty
pub fn is_nothing(&self) -> bool {
pub fn is_empty(&self) -> bool {
matches!(self, Node::Empty)
}
@ -80,12 +80,6 @@ impl<T : super::Base> Node<T> {
matches!(self, Node::Array(_))
}
/// true only if Node is empty
pub fn is_empty(&self) -> bool {
self.len() == 0
}
/// returns number of contained items (links count as items for len)
pub fn len(&self) -> usize {
match self {