1- // Copyright (C) 2018-2019 Stephane Raux. Distributed under the 0BSD license.
1+ // Copyright (C) 2018-2021 Stephane Raux. Distributed under the 0BSD license.
22
3+ //! # Overview
4+ //! - [📦 crates.io](https://crates.io/crates/enum-iterator)
5+ //! - [📖 Documentation](https://docs.rs/enum-iterator)
6+ //! - [⚖ 0BSD license](https://spdx.org/licenses/0BSD.html)
7+ //!
38//! Tools to iterate over the variants of a field-less enum.
49//!
5- //! See the `IntoEnumIterator` trait.
10+ //! See the [`IntoEnumIterator`] trait.
11+ //!
12+ //! # Example
13+ //! ```
14+ //! use enum_iterator::IntoEnumIterator;
15+ //!
16+ //! #[derive(Debug, IntoEnumIterator, PartialEq)]
17+ //! enum Day { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday }
18+ //!
19+ //! fn main() {
20+ //! assert_eq!(Day::into_enum_iter().next(), Some(Day::Monday));
21+ //! assert_eq!(Day::into_enum_iter().last(), Some(Day::Sunday));
22+ //! }
23+ //! ```
24+ //!
25+ //! # Contribute
26+ //! All contributions shall be licensed under the [0BSD license](https://spdx.org/licenses/0BSD.html).
627
728#![ deny( missing_docs) ]
829#![ deny( warnings) ]
@@ -24,7 +45,7 @@ use core::iter;
2445/// use enum_iterator::IntoEnumIterator;
2546///
2647/// #[derive(Clone, IntoEnumIterator, PartialEq)]
27- /// enum Direction {North, South, West, East}
48+ /// enum Direction { North, South, West, East }
2849///
2950/// fn main() {
3051/// assert_eq!(Direction::VARIANT_COUNT, 4);
0 commit comments