Skip to content

Commit

Permalink
Fix clippy::useless_conversion lint
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Jul 17, 2023
1 parent a4a006a commit 7a541cf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,10 @@ impl<'a> Bytes<'a> {
} else if x >= min_i32 && x <= max_i32 {
Ok(AnyNum::I32(x as i32))
} else if x >= min_i64 && x <= max_i64 {
#[cfg_attr(
not(feature = "integer128"),
allow(clippy::unnecessary_cast)
)]
Ok(AnyNum::I64(x as i64))
} else {
#[cfg(feature = "integer128")]
Expand Down Expand Up @@ -327,6 +331,10 @@ impl<'a> Bytes<'a> {
} else if x <= max_u32 {
Ok(AnyNum::U32(x as u32))
} else if x <= max_u64 {
#[cfg_attr(
not(feature = "integer128"),
allow(clippy::unnecessary_cast)
)]
Ok(AnyNum::U64(x as u64))
} else {
#[cfg(feature = "integer128")]
Expand Down

0 comments on commit 7a541cf

Please sign in to comment.