Add ListView::is_empty

This commit is contained in:
Alexandre Bury 2017-06-08 09:41:53 -07:00
parent cba8d53cf2
commit ffe5b57749

View File

@ -66,6 +66,14 @@ impl ListView {
self.children.len()
}
/// Returns `true` if this view contains no children.
///
/// Returns `false` if at least a delimiter or a view is present.
pub fn is_empty(&self) -> bool {
self.children.is_empty()
}
/// Returns a reference to the children
pub fn children(&self) -> &[ListChild] {
&self.children[..]