Skip to content

Commit 91a8814

Browse files
committed
cpubits: move usage example to README.md
1 parent 1f2bdb0 commit 91a8814

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

cpubits/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ Implemented as `macro_rules!`.
1515

1616
[Documentation][docs-link]
1717

18+
## Example
19+
20+
Below is a basic example of how you can use the `cpubits!` macro:
21+
22+
```rust
23+
cpubits::cpubits! {
24+
16 => { pub type Word = u16; }
25+
32 => { pub type Word = u32; }
26+
64 => { pub type Word = u64; }
27+
}
28+
```
29+
1830
## License
1931

2032
Licensed under either of:

cpubits/src/lib.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,10 @@
1414
//! - `64`
1515
//!
1616
//! This matches the available options for `target_pointer_width` in `rustc`:
17+
//!
1718
//! ```text
1819
//! expected values for `target_pointer_width` are: `16`, `32`, and `64`
1920
//! ```
20-
//!
21-
//! # Example
22-
//!
23-
//! See the [`cpubits`] macro itself for more detailed usage examples including other syntax
24-
//! variations.
25-
//!
26-
//! ```
27-
//! cpubits::cpubits! {
28-
//! 16 => { pub type Word = u16; }
29-
//! 32 => { pub type Word = u32; }
30-
//! 64 => { pub type Word = u64; }
31-
//! }
32-
//! ```
3321
3422
// End of toplevel rustdoc, beginning of macro documentation. We put the detailed docs on the macro
3523
// itself so we can re-export it, and people can easily get to these docs from the re-exported

0 commit comments

Comments
 (0)