1 2 3 4 5 6 7 8 9
use syn::{parse_quote, Type}; pub fn symbol_from_string(value: &str) -> Type { value .chars() .rfold(parse_quote! { Nil }, |tail, c: char| -> Type { parse_quote!( Cons< Char< #c >, #tail > ) }) }