Skip to content

Commit

Permalink
A few clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aldanor committed Oct 16, 2022
1 parent 617e0c8 commit 9a40115
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl FixedType {

pub fn from_ident(ident: &Ident) -> Result<Self, &'static str> {
fn parse_size(s: &str) -> Option<u8> {
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);
Expand Down Expand Up @@ -64,7 +64,7 @@ fn normalize_float(float: &str) -> Result<String, &'static str> {
}
_ => 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 {
Expand Down

0 comments on commit 9a40115

Please sign in to comment.