From 268d6c390bd11005a4180b0a333cf2851c2ce5e7 Mon Sep 17 00:00:00 2001 From: "flyingscorpio@clevo" Date: Sat, 7 Jan 2023 10:31:22 +0100 Subject: [PATCH] Use is_empty() istead of len() == 0 --- src/ear.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ear.rs b/src/ear.rs index dd5b328..9b80e28 100644 --- a/src/ear.rs +++ b/src/ear.rs @@ -108,7 +108,7 @@ fn handle_get_request(request: Request, mut sender: Mouth) { match request.section.as_str() { "titre" => match database::search_title_from_titre(&request.requested_data) { Ok(result) => { - if result.len() == 0 { + if result.is_empty() { sender.send_not_found(result); } else { sender.send_ok(result); @@ -118,7 +118,7 @@ fn handle_get_request(request: Request, mut sender: Mouth) { }, "favoris" => match database::search_favorites_from_titre(&request.requested_data) { Ok(result) => { - if result.len() == 0 { + if result.is_empty() { sender.send_not_found(result); } else { sender.send_ok(result);