From ffe5b577493249c0635d96f1325d4a41dd89dcdc Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Thu, 8 Jun 2017 09:41:53 -0700 Subject: [PATCH] Add ListView::is_empty --- src/views/list_view.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/views/list_view.rs b/src/views/list_view.rs index 0bff4df..fbd397a 100644 --- a/src/views/list_view.rs +++ b/src/views/list_view.rs @@ -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[..]