Use is_empty() istead of len() == 0
This commit is contained in:
parent
af80b3b62f
commit
268d6c390b
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue