From: Ian Jackson Date: Thu, 31 Mar 2022 00:21:33 +0000 (+0100) Subject: clippy: Prefer .len() > 0 to ! .is_empty() X-Git-Tag: otter-1.0.0~50 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=86d545587430064960e2ef6a65773034bd794f49;p=otter.git clippy: Prefer .len() > 0 to ! .is_empty() Signed-off-by: Ian Jackson --- diff --git a/base/html.rs b/base/html.rs index 304a7082..c26c430e 100644 --- a/base/html.rs +++ b/base/html.rs @@ -100,7 +100,6 @@ impl HtmlStr { let s = unsafe { mem::transmute::<&'s str, &'s HtmlStr>(s) }; s } - #[allow(clippy::len_without_is_empty)] pub fn len(&self) -> usize { self.0.len() } pub fn as_html_str(&self) -> &str { &self.0 } } diff --git a/clippy-options b/clippy-options index 76a721a0..7616a54e 100644 --- a/clippy-options +++ b/clippy-options @@ -20,3 +20,5 @@ -A clippy::type_complexity -A clippy::redundant_closure -A clippy::useless_format +-A clippy::len_zero +-A clippy::len_without_is_empty # I prefer comparing .len() to 0, apparently