fn parse_f32(arg: &str, name: &str) -> Result<f32, ParseError> {
	let val = arg.parse::<f32>();
	match val {
		Ok(v) => Ok(v),
		Err(e) => {
			let msg = format!("Could not parse {} as a decimal number. e={}", name, e);
			Err(ParseError::ArgumentError(msg))
		}
	}
}
// parses a number, or throws error with message otherwise
parses a number, or throws error with message otherwise
parses a number or throws error with message otherwise
fn parse_f32(arg: &str, name: &str) -> Result<f32, ParseError> {
	let val = arg.parse::<f32>();
	match val {
		Ok(v) => Ok(v),
		Err(e) => {
			let msg = format!("Could not parse {} as a decimal number. e={}", name, e);
			Err(ParseError::ArgumentError(msg))
		}
	}
}
fn parse_f32 ( arg : & str , name : & str ) -> Result < f32 , ParseError > { let val = arg . parse :: < f32 > ( ) ; match val { Ok ( v ) => Ok ( v ) , Err ( e ) => { let msg = format ! ( " " name e ) ; Err ( ParseError :: ArgumentError ( msg ) ) } } }
parses a number, or throws error with message otherwise
parses a number or throws error with message otherwise
arg
&str
name
&str
arg
&str
name
&str