From 53837d9a2e1cc70e180de39c16e2d212e958a9f3 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 8 Apr 2025 13:42:53 +1000 Subject: [PATCH] units: Improve crate level docs Add a bit more to the crate level docs. This is a simple crate so we don't need all that much. Done for: C-CRATE-DOC --- units/src/lib.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/units/src/lib.rs b/units/src/lib.rs index 0919efb73..b00a254cf 100644 --- a/units/src/lib.rs +++ b/units/src/lib.rs @@ -3,6 +3,20 @@ //! # Rust Bitcoin - unit types //! //! This library provides basic types used by the Rust Bitcoin ecosystem. +//! +//! If you are using `rust-bitcoin` then you do not need to access this crate directly. Everything +//! here is re-exported in `rust-bitcoin` at the same path. Also the same re-exports exist in +//! `primitives` if you are using that crate instead of `bitcoin`. +//! +//! # Examples +//! +//! ``` +//! // Exactly the same as `use bitcoin::{amount, Amount}`. +//! use bitcoin_units::{amount, Amount}; +//! +//! let amount = Amount::from_sat(1_000)?; +//! # Ok::<_, amount::OutOfRangeError>(()) +//! ``` #![no_std] // Experimental features we need.