Skip to content

Commit 789bd64

Browse files
committed
Document custom crate path
1 parent 993f9ae commit 789bd64

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

enum-iterator/src/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@
5353
//! assert_eq!(last::<Foo>(), Some(Foo { a: true, b: 255 }));
5454
//! ```
5555
//!
56+
//! # Custom crate path in generated code
57+
//!
58+
//! The code generated by the derive macro defaults to using `::enum_iterator` as the path for
59+
//! items defined in this crate. This can be customized using the
60+
//! `#[enum_iterator(crate = foo::bar)]` derive macro attribute.
61+
//!
62+
//! ```
63+
//! #[derive(enum_iterator::Sequence)]
64+
//! #[enum_iterator(crate = enum_iterator)]
65+
//! struct Foo;
66+
//! ```
67+
//!
5668
//! # Rust version
5769
//! This crate tracks stable Rust. Minor releases may require a newer Rust version. Patch releases
5870
//! must not require a newer Rust version.

0 commit comments

Comments
 (0)