enum-info 1.0.3

A crate to generate enum impls which can list basic info about an enum.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![allow(unused)]

use enum_info::enum_info;

#[test]
fn test_cow() {
	// Should have 2 variants: Borrowed(B), Owned(B::ToOwned)
	#[enum_info]
	pub enum Cow<'a, B: ?Sized + 'a> where B: ToOwned {
		Borrowed(&'a B),
		Owned(<B as ToOwned>::Owned),
	}
	
	assert_eq!(Cow::<()>::variant_count(), 2);
}