1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
use eval::Expr; #[derive(Debug, Clone)] pub struct Set { pub name: String, pub expr: Expr, } impl Set { pub fn new(name: String, expression: String) -> Set { Set { name: name, expr: Expr::new(expression).compile().unwrap(), } } }