Remove unused variables and methods from docs
Examples in documentation are not linted in the same way as other code, but should still contain correctly written code. Throughout the bitcoin crate unused variables have either been prefixed with _ or an assert used. And unused methods have been used in the example code.
This commit is contained in:
parent
e58cda6f92
commit
ff6b1d4f19
|
@ -288,14 +288,14 @@ pub enum AddressData {
|
||||||
///
|
///
|
||||||
/// // variant 1
|
/// // variant 1
|
||||||
/// let address: Address<NetworkUnchecked> = "32iVBEu4dxkUQk9dJbZUiBiQdmypcEyJRf".parse().unwrap();
|
/// let address: Address<NetworkUnchecked> = "32iVBEu4dxkUQk9dJbZUiBiQdmypcEyJRf".parse().unwrap();
|
||||||
/// let address: Address<NetworkChecked> = address.require_network(Network::Bitcoin).unwrap();
|
/// let _address: Address<NetworkChecked> = address.require_network(Network::Bitcoin).unwrap();
|
||||||
///
|
///
|
||||||
/// // variant 2
|
/// // variant 2
|
||||||
/// let address: Address = Address::from_str("32iVBEu4dxkUQk9dJbZUiBiQdmypcEyJRf").unwrap()
|
/// let _address: Address = Address::from_str("32iVBEu4dxkUQk9dJbZUiBiQdmypcEyJRf").unwrap()
|
||||||
/// .require_network(Network::Bitcoin).unwrap();
|
/// .require_network(Network::Bitcoin).unwrap();
|
||||||
///
|
///
|
||||||
/// // variant 3
|
/// // variant 3
|
||||||
/// let address: Address<NetworkChecked> = "32iVBEu4dxkUQk9dJbZUiBiQdmypcEyJRf".parse::<Address<_>>()
|
/// let _address: Address<NetworkChecked> = "32iVBEu4dxkUQk9dJbZUiBiQdmypcEyJRf".parse::<Address<_>>()
|
||||||
/// .unwrap().require_network(Network::Bitcoin).unwrap();
|
/// .unwrap().require_network(Network::Bitcoin).unwrap();
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
|
|
@ -61,6 +61,8 @@
|
||||||
//! # let _ = target.difficulty(signet);
|
//! # let _ = target.difficulty(signet);
|
||||||
//! #
|
//! #
|
||||||
//! # let custom = CustomParams::new();
|
//! # let custom = CustomParams::new();
|
||||||
|
//! # let _ = custom.magic();
|
||||||
|
//! # let _ = custom.challenge_script();
|
||||||
//! # let _ = target.difficulty(custom);
|
//! # let _ = target.difficulty(custom);
|
||||||
//! # }
|
//! # }
|
||||||
//! ```
|
//! ```
|
||||||
|
|
|
@ -144,8 +144,8 @@ pub struct Input {
|
||||||
/// use bitcoin::{EcdsaSighashType, TapSighashType};
|
/// use bitcoin::{EcdsaSighashType, TapSighashType};
|
||||||
/// use bitcoin::psbt::PsbtSighashType;
|
/// use bitcoin::psbt::PsbtSighashType;
|
||||||
///
|
///
|
||||||
/// let ecdsa_sighash_all: PsbtSighashType = EcdsaSighashType::All.into();
|
/// let _ecdsa_sighash_all: PsbtSighashType = EcdsaSighashType::All.into();
|
||||||
/// let tap_sighash_all: PsbtSighashType = TapSighashType::All.into();
|
/// let _tap_sighash_all: PsbtSighashType = TapSighashType::All.into();
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||||
|
@ -208,8 +208,8 @@ impl PsbtSighashType {
|
||||||
/// ```
|
/// ```
|
||||||
/// use bitcoin::{EcdsaSighashType, TapSighashType};
|
/// use bitcoin::{EcdsaSighashType, TapSighashType};
|
||||||
/// use bitcoin::psbt::PsbtSighashType;
|
/// use bitcoin::psbt::PsbtSighashType;
|
||||||
/// let ecdsa_sighash_anyone_can_pay: PsbtSighashType = EcdsaSighashType::AllPlusAnyoneCanPay.into();
|
/// let _ecdsa_sighash_anyone_can_pay: PsbtSighashType = EcdsaSighashType::AllPlusAnyoneCanPay.into();
|
||||||
/// let tap_sighash_anyone_can_pay: PsbtSighashType = TapSighashType::AllPlusAnyoneCanPay.into();
|
/// let _tap_sighash_anyone_can_pay: PsbtSighashType = TapSighashType::AllPlusAnyoneCanPay.into();
|
||||||
/// ```
|
/// ```
|
||||||
pub const ALL: PsbtSighashType = PsbtSighashType { inner: 0x01 };
|
pub const ALL: PsbtSighashType = PsbtSighashType { inner: 0x01 };
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue