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:
parent
a852aef4b8
commit
52940d4e12
|
@ -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>(())
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
|
|
|
@ -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>(())
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in New Issue