diff --git a/bitcoin/src/blockdata/weight.rs b/bitcoin/src/blockdata/weight.rs index 3fad1a1c..4843685e 100644 --- a/bitcoin/src/blockdata/weight.rs +++ b/bitcoin/src/blockdata/weight.rs @@ -63,11 +63,9 @@ impl Weight { match vb.checked_mul(Self::WITNESS_SCALE_FACTOR) { Some(weight) => Weight(weight), None => { - // TODO replace with panic!() when MSRV = 1.57+ + // When MSRV is 1.57+ we can use `panic!()`. #[allow(unconditional_panic)] - // disabling this lint until panic!() can be used. #[allow(clippy::let_unit_value)] - // disabling this lint until panic!() can be used. #[allow(clippy::out_of_bounds_indexing)] let _int_overflow_scaling_weight = [(); 0][1]; Weight(0) diff --git a/bitcoin/src/consensus/serde.rs b/bitcoin/src/consensus/serde.rs index 6c9c9c32..a6b88aed 100644 --- a/bitcoin/src/consensus/serde.rs +++ b/bitcoin/src/consensus/serde.rs @@ -98,7 +98,6 @@ pub mod hex { } // Newtypes to hide internal details. - // TODO: statically prove impossible cases /// Error returned when a hex string decoder can't be created. #[derive(Debug, Clone, Copy, PartialEq, Eq)] diff --git a/bitcoin/src/pow.rs b/bitcoin/src/pow.rs index d0990b05..ad38dd86 100644 --- a/bitcoin/src/pow.rs +++ b/bitcoin/src/pow.rs @@ -442,7 +442,6 @@ impl U256 { [self.1 as u64, (self.1 >> 64) as u64, self.0 as u64, (self.0 >> 64) as u64]; for word in &mut split_le { - // TODO: Use `carrying_mul` when stabilized: https://github.com/rust-lang/rust/issues/85532 // This will not overflow, for proof see https://github.com/rust-bitcoin/rust-bitcoin/pull/1496#issuecomment-1365938572 let n = carry + u128::from(rhs) * u128::from(*word); diff --git a/units/src/amount.rs b/units/src/amount.rs index bb760b74..559c9562 100644 --- a/units/src/amount.rs +++ b/units/src/amount.rs @@ -716,15 +716,12 @@ impl Amount { /// The function panics if the argument multiplied by the number of sats /// per bitcoin overflows a u64 type. pub const fn from_int_btc(btc: u64) -> Amount { - // TODO replace whith unwrap() when available in const context. match btc.checked_mul(100_000_000) { Some(amount) => Amount::from_sat(amount), None => { - // TODO replace with panic!() when MSRV = 1.57+ + // When MSRV is 1.57+ we can use `panic!()`. #[allow(unconditional_panic)] - // disabling this lint until panic!() can be used. #[allow(clippy::let_unit_value)] - // disabling this lint until panic!() can be used. #[allow(clippy::out_of_bounds_indexing)] let _int_overflow_converting_btc_to_sats = [(); 0][1]; Amount(0)