Skip to content

Commit

Permalink
util/rangeint: squash new warnings on nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
BurntSushi committed Aug 14, 2024
1 parent c659069 commit 7da2731
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/util/rangeint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ macro_rules! define_ranged {
val: impl Into<i64>,
) -> Result<Self, Error> {
let val = val.into();
#[allow(irrefutable_let_patterns)]
let Ok(val) = <$repr>::try_from(val) else {
return Err(Error::signed(
what,
Expand All @@ -130,6 +131,7 @@ macro_rules! define_ranged {
val: impl Into<i128>,
) -> Result<Self, Error> {
let val = val.into();
#[allow(irrefutable_let_patterns)]
let Ok(val) = <$repr>::try_from(val) else {
return Err(Error::signed(
what,
Expand Down Expand Up @@ -926,6 +928,7 @@ macro_rules! define_ranged {
// that can't fit in the actual integer representation.
// This makes doing things like `number % one-plus-max`
// much more convenient.
#[allow(irrefutable_let_patterns)]
let Ok(val) = <$repr>::try_from(c.value()) else {
panic!(
"{c:?} does not fit in {name:?}",
Expand Down

0 comments on commit 7da2731

Please sign in to comment.