tlkit 0.3.0

Tool Kit integration
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use syn::{parse_quote, DeriveInput};
use tlkit_expand::enumer::try_from;

#[test]
fn test_try_from_expand() -> syn::Result<()> {
    let input: DeriveInput = parse_quote! {
        #[derive(Debug, EnumTryFrom)]
        pub enum Language {
            Chinese,

            English,
        }
    };
    let token_stream = try_from::expand(input).unwrap().to_string();
    println!("{token_stream}");
    Ok(())
}