This repository has been archived on 2022-07-24. You can view files and clone it, but cannot push or open issues or pull requests.
itconfig/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(())
}