From c69caafefca08453dbc13a64c5933f7efe209272 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 1 Feb 2024 12:37:53 +1100 Subject: [PATCH] Remove attribute comments Add an issue and remove the TODO from the code as well as the attribute comments, leave a single comment as an explanation of why the unusual code block. ref: https://github.com/rust-bitcoin/rust-bitcoin/issues/2427 --- bitcoin/src/blockdata/weight.rs | 4 +--- units/src/amount.rs | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) 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/units/src/amount.rs b/units/src/amount.rs index 2981e067..08c0491a 100644 --- a/units/src/amount.rs +++ b/units/src/amount.rs @@ -719,11 +719,9 @@ impl Amount { 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)