penum 0.1.30

Make enum conform to a given pattern
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![allow(dead_code)]
extern crate penum;

#[penum::into(String)]
enum Foo {
    Bar = "Bar".to_string(),
    Ber = "Ber".to_string(),
    Bur(&'static str) = format!("{f0}"),
}

fn main() {
    let bar = Foo::Bur("10");
    let string: String = bar.into();
    assert_eq!(string, "10");
}