mirror of
https://github.com/danog/strum.git
synced 2024-12-13 01:47:29 +01:00
b517f232aa
* Set all crates to edition 2018 * Remove redundant imports * Remove extern crate declarations for cargo dependencies
19 lines
310 B
Rust
19 lines
310 B
Rust
use strum::{EnumCount, EnumIter, IntoEnumIterator};
|
|
|
|
#[derive(Debug, EnumCount, EnumIter)]
|
|
enum Week {
|
|
Sunday,
|
|
Monday,
|
|
Tuesday,
|
|
Wednesday,
|
|
Thursday,
|
|
Friday,
|
|
Saturday,
|
|
}
|
|
|
|
#[test]
|
|
fn simple_test() {
|
|
assert_eq!(7, Week::COUNT);
|
|
assert_eq!(Week::iter().count(), Week::COUNT);
|
|
}
|