1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
mod ast; mod eval; mod parser; mod string; pub use eval::evaluate; trait Wrap<T> { fn wrap<F, U>(self, f: F) -> U where F: Fn(T) -> U, Self: Sized; fn wrap_ok<E>(self) -> Result<Self, E> where Self: Sized, { Ok(self) } } impl<T> Wrap<T> for T { fn wrap<F, U>(self, f: F) -> U where F: Fn(T) -> U, { f(self) } }