diff --git a/bitcoin/src/bip158.rs b/bitcoin/src/bip158.rs index a820e9978..4d0bc4d38 100644 --- a/bitcoin/src/bip158.rs +++ b/bitcoin/src/bip158.rs @@ -480,6 +480,7 @@ impl<'a, R: BufRead + ?Sized> BitStreamReader<'a, R> { /// Reads nbit bits, returning the bits in a `u64` starting with the rightmost bit. /// /// # Examples + /// /// ``` /// # use bitcoin::bip158::BitStreamReader; /// # let data = vec![0xff]; diff --git a/bitcoin/src/blockdata/locktime/absolute.rs b/bitcoin/src/blockdata/locktime/absolute.rs index 548bf8e30..52669d8ab 100644 --- a/bitcoin/src/blockdata/locktime/absolute.rs +++ b/bitcoin/src/blockdata/locktime/absolute.rs @@ -45,6 +45,7 @@ pub use units::locktime::absolute::{ /// * [BIP-113 Median time-past as endpoint for lock-time calculations](https://github.com/bitcoin/bips/blob/master/bip-0113.mediawiki) /// /// # Examples +/// /// ``` /// # use bitcoin::absolute::{LockTime, LockTime::*}; /// # let n = LockTime::from_consensus(741521); // n OP_CHECKLOCKTIMEVERIFY @@ -61,6 +62,7 @@ pub enum LockTime { /// A block height lock time value. /// /// # Examples + /// /// ```rust /// use bitcoin::absolute::LockTime; /// @@ -73,6 +75,7 @@ pub enum LockTime { /// A UNIX timestamp lock time value. /// /// # Examples + /// /// ```rust /// use bitcoin::absolute::LockTime; /// @@ -141,6 +144,7 @@ impl LockTime { /// See [`LOCK_TIME_THRESHOLD`] for definition of a valid height value. /// /// # Examples + /// /// ```rust /// # use bitcoin::absolute::LockTime; /// assert!(LockTime::from_height(741521).is_ok()); @@ -157,6 +161,7 @@ impl LockTime { /// See [`LOCK_TIME_THRESHOLD`] for definition of a valid time value. /// /// # Examples + /// /// ```rust /// # use bitcoin::absolute::LockTime; /// assert!(LockTime::from_time(1653195600).is_ok()); @@ -196,6 +201,7 @@ impl LockTime { /// `height`/`time` is valid. /// /// # Examples + /// /// ```no_run /// # use bitcoin::absolute::{LockTime, Height, Time}; /// // Can be implemented if block chain data is available. diff --git a/bitcoin/src/crypto/key.rs b/bitcoin/src/crypto/key.rs index 5d8abc6a5..0c0f9d2d4 100644 --- a/bitcoin/src/crypto/key.rs +++ b/bitcoin/src/crypto/key.rs @@ -710,6 +710,7 @@ pub type UntweakedKeypair = Keypair; /// Tweaked BIP-340 key pair /// /// # Examples +/// /// ``` /// # #[cfg(feature = "rand-std")] { /// # use bitcoin::key::{Keypair, TweakedKeypair, TweakedPublicKey}; diff --git a/internals/src/macros.rs b/internals/src/macros.rs index 715f9cb78..4478c3545 100644 --- a/internals/src/macros.rs +++ b/internals/src/macros.rs @@ -122,7 +122,7 @@ macro_rules! const_assert { /// /// Note: Paths are not supported (for ex. impl_from_infallible!(Hello). /// -/// ## Examples +/// # Examples /// /// ```rust /// # use core::fmt::{Display, Debug}; diff --git a/units/src/amount.rs b/units/src/amount.rs index 6562585ba..98e8216c8 100644 --- a/units/src/amount.rs +++ b/units/src/amount.rs @@ -21,6 +21,7 @@ use internals::write_err; /// A set of denominations in which amounts can be expressed. /// /// # Examples +/// /// ``` /// # use core::str::FromStr; /// # use bitcoin_units::Amount; @@ -939,6 +940,7 @@ impl Amount { /// Please be aware of the risk of using floating-point numbers. /// /// # Examples + /// /// ``` /// # use bitcoin_units::amount::{Amount, Denomination}; /// let amount = Amount::from_sat(100_000); diff --git a/units/src/locktime/absolute.rs b/units/src/locktime/absolute.rs index f786c0b6c..49e1499d0 100644 --- a/units/src/locktime/absolute.rs +++ b/units/src/locktime/absolute.rs @@ -51,6 +51,7 @@ impl Height { /// If `n` does not represent a valid block height value. /// /// # Examples + /// /// ```rust /// use bitcoin_units::locktime::absolute::Height; /// @@ -146,6 +147,7 @@ impl Time { /// If `n` does not encode a valid UNIX time stamp. /// /// # Examples + /// /// ```rust /// use bitcoin_units::locktime::absolute::Time; ///