Skip to content

Commit 4ade08c

Browse files
committed
Merge rust-bitcoin#3831: units: Don't ignore serde examples
0e5d6db units: Don't ignore serde examples (Tobin C. Harding) Pull request description: There is no reason to ignore the rustdoc example in `units::amount::serde`. The `as_btc` function requires the `alloc` features so use `as_sat` in the example instead. While we are at it clean up the whole block of rustdocs. ACKs for top commit: apoelstra: ACK 0e5d6db; successfully ran local tests Tree-SHA512: d108779faa8baf5c8a1cb533e44e8ac209e3e1001eb8ec8ae1f9ba9b0cf5f8c45c38df77e15193cdc990fcd0fbf48bca489aadbd196c6323560040b7fd043332
2 parents 75c8ec4 + 0e5d6db commit 4ade08c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

units/src/amount/serde.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@
33
// methods are implementation of a standardized serde-specific signature
44
#![allow(missing_docs)]
55

6-
//! This module adds serde serialization and deserialization support for Amounts.
6+
//! This module adds serde serialization and deserialization support for amounts.
77
//!
8-
//! Since there is not a default way to serialize and deserialize Amounts, multiple
9-
//! ways are supported and it's up to the user to decide which serialiation to use.
10-
//! The provided modules can be used as follows:
8+
//! Since there is not a default way to serialize and deserialize amounts, multiple
9+
//! ways are supported and it's up to the user to decide which serialization to use.
1110
//!
12-
//! ```rust,ignore
11+
//! # Examples
12+
//!
13+
//! ```
1314
//! use serde::{Serialize, Deserialize};
1415
//! use bitcoin_units::Amount;
1516
//!
1617
//! #[derive(Serialize, Deserialize)]
1718
//! pub struct HasAmount {
18-
//! #[serde(with = "bitcoin_units::amount::serde::as_btc")]
19+
//! #[serde(with = "bitcoin_units::amount::serde::as_sat")]
1920
//! pub amount: Amount,
2021
//! }
2122
//! ```

0 commit comments

Comments
 (0)