units: Remove expect from rustdoc example
We can just assert against an explicit `Some` value instead of using `expect`.
This commit is contained in:
parent
7307c115e8
commit
53c6ae4d40
|
@ -31,8 +31,8 @@ impl Amount {
|
||||||
/// # use bitcoin_units::{amount, Amount, FeeRate, Weight};
|
/// # use bitcoin_units::{amount, Amount, FeeRate, Weight};
|
||||||
/// let amount = Amount::from_sat(10)?;
|
/// let amount = Amount::from_sat(10)?;
|
||||||
/// let weight = Weight::from_wu(300);
|
/// let weight = Weight::from_wu(300);
|
||||||
/// let fee_rate = amount.checked_div_by_weight_ceil(weight).expect("Division by weight failed");
|
/// let fee_rate = amount.checked_div_by_weight_ceil(weight);
|
||||||
/// assert_eq!(fee_rate, FeeRate::from_sat_per_kwu(34));
|
/// assert_eq!(fee_rate, Some(FeeRate::from_sat_per_kwu(34)));
|
||||||
/// # Ok::<_, amount::OutOfRangeError>(())
|
/// # Ok::<_, amount::OutOfRangeError>(())
|
||||||
/// ```
|
/// ```
|
||||||
#[must_use]
|
#[must_use]
|
||||||
|
|
Loading…
Reference in New Issue