From 836bfcd7dd5d5b012195538fae6c22df840706f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sat, 24 Sep 2022 17:38:21 +0200 Subject: [PATCH] TestComponent: Use is_empty instead of .len == 0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- src/component.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/component.rs b/src/component.rs index d02ff75..8e5faca 100644 --- a/src/component.rs +++ b/src/component.rs @@ -286,9 +286,8 @@ impl Drop for TestComponent { // while panicking" even when nobody asks for it (RUST_BACKTRACE unset). Let the error // appear if there isn't any other error. if !thread::panicking() { - assert_eq!( - self.expect_buffer.len(), - 0, + assert!( + self.expect_buffer.is_empty(), "Remaining expected elements in the buffer" ); }