From 8f18cf22087ada246566a0cc3faeb694bcb93389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sat, 16 Dec 2023 00:20:03 +0100 Subject: [PATCH] minidom: fix boolean test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue introduced in 60ebcb8c8a425cb5f34a4f8c7afb40506d01983e. Signed-off-by: Maxime “pep” Buquet --- minidom/src/element.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/minidom/src/element.rs b/minidom/src/element.rs index 996f600..b1f3ed1 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); }