From 52940d4e1216ad5118f7980cb2e6b8b425c61589 Mon Sep 17 00:00:00 2001 From: "Jamil Lambert, PhD" Date: Tue, 6 May 2025 10:28:51 +0100 Subject: [PATCH] Prefix unused variables with _ in rustdocs There is a lint warning about unused variables in the rustdoc examples. Prefix them with an underscore. --- units/src/lib.rs | 2 +- units/src/result.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/units/src/lib.rs b/units/src/lib.rs index 41c33b017..ffc1cf562 100644 --- a/units/src/lib.rs +++ b/units/src/lib.rs @@ -14,7 +14,7 @@ //! // Exactly the same as `use bitcoin::{amount, Amount}`. //! use bitcoin_units::{amount, Amount}; //! -//! let amount = Amount::from_sat(1_000)?; +//! let _amount = Amount::from_sat(1_000)?; //! # Ok::<_, amount::OutOfRangeError>(()) //! ``` diff --git a/units/src/result.rs b/units/src/result.rs index 0ced0a2db..0416388f1 100644 --- a/units/src/result.rs +++ b/units/src/result.rs @@ -39,12 +39,12 @@ use crate::{Amount, FeeRate, SignedAmount, Weight}; /// // /// // For example if the `spend` value comes from the user and the `change` value is later /// // used then overflow here could be an attack vector. -/// let change = (a1 + a2 - spend - fee).into_result().expect("handle this error"); +/// let _change = (a1 + a2 - spend - fee).into_result().expect("handle this error"); /// /// // Or if we control all the values and know they are sane we can just `unwrap`. -/// let change = (a1 + a2 - spend - fee).unwrap(); +/// let _change = (a1 + a2 - spend - fee).unwrap(); /// // `NumOpResult` also implements `expect`. -/// let change = (a1 + a2 - spend - fee).expect("we know values don't overflow"); +/// let _change = (a1 + a2 - spend - fee).expect("we know values don't overflow"); /// # Ok::<_, amount::OutOfRangeError>(()) /// ``` ///