From f8d653e0b1e51b353bfb58e30d4397521c9ad008 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mina=20Gali=C4=87?= Date: Fri, 29 May 2020 22:54:44 +0200 Subject: [PATCH] implement is_empty() and use it according to Clippy's prophecy. --- src/actor/actor_cell.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/actor/actor_cell.rs b/src/actor/actor_cell.rs index ad4bf51b..fb27634d 100644 --- a/src/actor/actor_cell.rs +++ b/src/actor/actor_cell.rs @@ -111,7 +111,7 @@ impl ActorCell { } pub fn has_children(&self) -> bool { - self.inner.children.len() > 0 + !self.inner.children.is_empty() } pub(crate) fn children<'a>(&'a self) -> Box + 'a> { @@ -724,6 +724,10 @@ impl Children { self.actors.read().unwrap().len() } + pub fn is_empty(&self) -> bool { + self.actors.read().unwrap().is_empty() + } + pub fn iter(&self) -> ChildrenIterator { ChildrenIterator { children: self,