diff --git a/minidom/src/element.rs b/minidom/src/element.rs index 996f6005..b1f3ed15 100644 --- a/minidom/src/element.rs +++ b/minidom/src/element.rs @@ -711,7 +711,7 @@ impl Element { /// Remove the leading nodes up to the first child element and /// return it pub fn unshift_child(&mut self) -> Option { - while self.children.is_empty() { + while !self.children.is_empty() { if let Some(el) = self.children.remove(0).into_element() { return Some(el); }