[librsvg: 21/23] Clippy - is_empty() instead of len() == 0
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 21/23] Clippy - is_empty() instead of len() == 0
- Date: Mon, 24 May 2021 17:47:33 +0000 (UTC)
commit e830247711653cdb1b85c3a84439e992a201ad21
Author: Federico Mena Quintero <federico gnome org>
Date: Fri May 21 20:13:21 2021 -0500
Clippy - is_empty() instead of len() == 0
src/accept_language.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/accept_language.rs b/src/accept_language.rs
index 545dfea7..bdf95e3b 100644
--- a/src/accept_language.rs
+++ b/src/accept_language.rs
@@ -87,14 +87,14 @@ impl AcceptLanguage {
for val in s.split(',') {
let trimmed = val.trim_matches(&OWS[..]);
- if trimmed.len() == 0 {
+ if trimmed.is_empty() {
continue;
}
items.push(Item::parse(trimmed)?);
}
- if items.len() == 0 {
+ if items.is_empty() {
Err(AcceptLanguageError::NoElements)
} else {
Ok(AcceptLanguage(items.into_boxed_slice()))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]