Use is_empty() istead of len() == 0

This commit is contained in:
flyingscorpio@clevo 2023-01-07 10:31:22 +01:00
parent af80b3b62f
commit 268d6c390b

View file

@ -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);