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

16 lines
315 B
Rust
Raw Normal View History

2022-07-22 18:39:29 +03:00
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(())
}