From 9a40115fa7d277fd9e7ac6245c3638f5722b838f Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Sun, 16 Oct 2022 23:18:08 +0100 Subject: [PATCH] A few clippy fixes --- impl/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/impl/src/lib.rs b/impl/src/lib.rs index cf200a1..68983b6 100644 --- a/impl/src/lib.rs +++ b/impl/src/lib.rs @@ -25,7 +25,7 @@ impl FixedType { pub fn from_ident(ident: &Ident) -> Result { fn parse_size(s: &str) -> Option { - if s.chars().next()?.is_digit(10) { + if s.chars().next()?.is_ascii_digit() { let num = u8::from_str(s).ok()?; if num <= 128 { return Some(num); @@ -64,7 +64,7 @@ fn normalize_float(float: &str) -> Result { } _ => 0, }; - let idx = float.find('.').unwrap_or_else(|| float.len()); + let idx = float.find('.').unwrap_or(float.len()); let mut int = float[..idx].to_owned(); let mut frac = float[idx + 1..].to_owned(); while exp > 0 {