This repository has been archived on 2024-07-25. You can view files and clone it, but cannot push or open issues or pull requests.
enve/examples/calc.rs

15 lines
315 B
Rust

use enve::core::SepVec;
type PlusVec<T> = SepVec<T, '+'>;
type MulVec<T> = SepVec<T, '*'>;
fn main() -> Result<(), enve::Error> {
let res: f32 = enve::get::<PlusVec<MulVec<f32>>>("E")?
.iter()
.map(|m| m.iter().product::<f32>())
.sum();
println!("result: {}", res);
Ok(())
}