Skip to content

Commit 9689d7b

Browse files
authored
add hyperlinks to documentation and clarify derive macros (#355)
this makes it easier to navigate the documentation. one comment seemed to suggest that the reexport of the derive macros was depricated, however that has been ignored for several reasons: 1. exposing macros through a derive feature flag is common practice, see the serde crate for an example. 2. using a feature flag means you can't accidentally have a version mismatch. 3. the reexport is used in several examples 4. the only evidence of deprication is a private comment, which would never be seen by normal users of the crate. Co-authored-by: binarycat <[email protected]>
1 parent 186d29f commit 9689d7b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

strum/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl std::error::Error for ParseError {
6767
}
6868

6969
/// This trait designates that an `Enum` can be iterated over. It can
70-
/// be auto generated using `strum_macros` on your behalf.
70+
/// be auto generated using the [`EnumIter`](derive.EnumIter.html) derive macro.
7171
///
7272
/// # Example
7373
///

strum_macros/src/lib.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
//! Strum is a set of macros and traits for working with
44
//! enums and strings easier in Rust.
55
//!
6+
//! This crate only contains derive macros for use with the
7+
//! [`strum`](https://docs.rs/strum)
8+
//! crate. The macros provied by this crate are also available by
9+
//! enabling the `derive` feature in aforementioned `strum` crate.
610
711
#![recursion_limit = "128"]
812

@@ -428,7 +432,7 @@ pub fn display(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
428432
/// Creates a new type that iterates of the variants of an enum.
429433
///
430434
/// Iterate over the variants of an Enum. Any additional data on your variants will be set to `Default::default()`.
431-
/// The macro implements `strum::IntoEnumIterator` on your enum and creates a new type called `YourEnumIter` that is the iterator object.
435+
/// The macro implements [`strum::IntoEnumIterator`](https://docs.rs/strum/latest/strum/trait.IntoEnumIterator.html) on your enum and creates a new type called `YourEnumIter` that is the iterator object.
432436
/// You cannot derive `EnumIter` on any type with a lifetime bound (`<'a>`) because the iterator would surely
433437
/// create [unbounded lifetimes](https://doc.rust-lang.org/nightly/nomicon/unbounded-lifetimes.html).
434438
///

0 commit comments

Comments
 (0)