use enve::SepVec; type MinusVec = SepVec; type PlusVec = SepVec; type MulVec = SepVec; const HELP_MESSAGE: &str = " USAGE: E=10+10*2+4 cargo run --example calc --all-features "; fn main() -> Result<(), enve::Error> { let res: f32 = enve::get::>>>("E") .map_err(|err| { match err { enve::Error::NotPresent => eprintln!("The expression was not found"), rest => eprintln!("ERROR: {}", rest), } eprintln!("{}", HELP_MESSAGE); std::process::exit(0); }) .unwrap() .iter() .map(|p| { p.iter() .map(|m| m.iter().product::()) .reduce(|acc, v| acc - v) .unwrap_or_default() }) .sum::(); println!("result: {}", res); Ok(()) }