From 36ef4a62cfff2d2830d9fe055a8af8be97afa4c1 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 3 Apr 2024 11:37:09 +1100 Subject: [PATCH 1/2] units: Improve re-exports Make an attempt to improve the ergonomics and docs clarity of the `units` crate. - Don't inline error type re-exports, this keeps them up in the "Re-exports" section and saves cluttering the other inlined docs. - Re-export and inline the docs for `FeeRate` and `Weight` same as we do for `Amount`. This makes the "Structs" section of the docs nice except for the exclusion of the locktime types (which cannot be helped). --- units/src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/units/src/lib.rs b/units/src/lib.rs index 0da62a64..b2c27879 100644 --- a/units/src/lib.rs +++ b/units/src/lib.rs @@ -46,9 +46,16 @@ pub mod parse; pub mod weight; #[doc(inline)] -pub use self::amount::{Amount, ParseAmountError, SignedAmount}; +pub use self::amount::{Amount, SignedAmount}; +pub use self::amount::ParseAmountError; #[cfg(feature = "alloc")] pub use self::parse::ParseIntError; +#[cfg(feature = "alloc")] +#[doc(inline)] +pub use self::{ + fee_rate::FeeRate, + weight::Weight, +}; #[rustfmt::skip] #[allow(unused_imports)] From a05da2294e2b5e423756b669b54a94ca01e5a68d Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 3 Apr 2024 11:27:34 +1100 Subject: [PATCH 2/2] units: Add an initial changelog In preparation for the initial release add a changelog. Note the version number is already set to `v0.1.0` and this does not conflict with the release currently on crates.io `v0.0.0`. --- units/CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 units/CHANGELOG.md diff --git a/units/CHANGELOG.md b/units/CHANGELOG.md new file mode 100644 index 00000000..e2c14218 --- /dev/null +++ b/units/CHANGELOG.md @@ -0,0 +1,17 @@ +# 0.1.0 - Initial Release - 2024-04-03 + +Initial release of the `bitcoin-units` crate. These unit types are +integer wrapper types used by the `rust-bitcoin` ecosystem. Note +please that this release relies heavily on the "alloc" feature. + +The main types are: + +- `Amount` +- `locktime::absolute::{Height, Time}` +- `locktime::relative::{Height, Time}` +- `FeeRate` +- `Weight` + +# 0.0.0 - Placeholder release + +Empty crate to reserve the name on crates.io \ No newline at end of file