From 91a88147d431fb5ae361589ec489b34117cedd9b Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Tue, 20 Jan 2026 22:34:23 -0700 Subject: [PATCH] cpubits: move usage example to README.md --- cpubits/README.md | 12 ++++++++++++ cpubits/src/lib.rs | 14 +------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cpubits/README.md b/cpubits/README.md index f6240e49..d44c898b 100644 --- a/cpubits/README.md +++ b/cpubits/README.md @@ -15,6 +15,18 @@ Implemented as `macro_rules!`. [Documentation][docs-link] +## Example + +Below is a basic example of how you can use the `cpubits!` macro: + +```rust +cpubits::cpubits! { + 16 => { pub type Word = u16; } + 32 => { pub type Word = u32; } + 64 => { pub type Word = u64; } +} +``` + ## License Licensed under either of: diff --git a/cpubits/src/lib.rs b/cpubits/src/lib.rs index 55be2179..042602e8 100644 --- a/cpubits/src/lib.rs +++ b/cpubits/src/lib.rs @@ -14,22 +14,10 @@ //! - `64` //! //! This matches the available options for `target_pointer_width` in `rustc`: +//! //! ```text //! expected values for `target_pointer_width` are: `16`, `32`, and `64` //! ``` -//! -//! # Example -//! -//! See the [`cpubits`] macro itself for more detailed usage examples including other syntax -//! variations. -//! -//! ``` -//! cpubits::cpubits! { -//! 16 => { pub type Word = u16; } -//! 32 => { pub type Word = u32; } -//! 64 => { pub type Word = u64; } -//! } -//! ``` // End of toplevel rustdoc, beginning of macro documentation. We put the detailed docs on the macro // itself so we can re-export it, and people can easily get to these docs from the re-exported