Prefix unused variables with _ in rustdocs

There is a lint warning about unused variables in the rustdoc examples.

Prefix them with an underscore.
This commit is contained in:
Jamil Lambert, PhD 2025-05-06 10:28:51 +01:00
parent a852aef4b8
commit 52940d4e12
No known key found for this signature in database
GPG Key ID: 54DC29234AB5D2C0
2 changed files with 4 additions and 4 deletions

View File

@ -14,7 +14,7 @@
//! // Exactly the same as `use bitcoin::{amount, Amount}`. //! // Exactly the same as `use bitcoin::{amount, Amount}`.
//! use bitcoin_units::{amount, Amount}; //! use bitcoin_units::{amount, Amount};
//! //!
//! let amount = Amount::from_sat(1_000)?; //! let _amount = Amount::from_sat(1_000)?;
//! # Ok::<_, amount::OutOfRangeError>(()) //! # Ok::<_, amount::OutOfRangeError>(())
//! ``` //! ```

View File

@ -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 /// // 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. /// // 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`. /// // 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`. /// // `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>(()) /// # Ok::<_, amount::OutOfRangeError>(())
/// ``` /// ```
/// ///