fix(apb): is_nothing -> is_empty
This commit is contained in:
parent
4b632faf2a
commit
cfff8fb053
2 changed files with 2 additions and 8 deletions
|
@ -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()))
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue