fn parse_numeric_value<T>(matches: &ArgMatches, key: &str) -> T
where
    T: Num + FromStr,
{
    let s = matches.value_of(key).unwrap();
    match s.parse() {
        Ok(n) => n,
        Err(_) => {
            eprintln!("Expected a number, but got: {}", s);
            process::exit(1);
        }
    }
}
// Parses a key with a numeric value; expects that the key is present and has a value.
Parses a key with a numeric value; expects that the key is present and has a value.
Parses a key with a numeric value ; expects that the key is present and has a value .
fn parse_numeric_value<T>(matches: &ArgMatches, key: &str) -> T
where
    T: Num + FromStr,
{
    let s = matches.value_of(key).unwrap();
    match s.parse() {
        Ok(n) => n,
        Err(_) => {
            eprintln!("Expected a number, but got: {}", s);
            process::exit(1);
        }
    }
}
fn parse_numeric_value < T > ( matches : & ArgMatches , key : & str ) -> T where T : Num + FromStr , { let s = matches . value_of ( key ) . unwrap ( ) ; match s . parse ( ) { Ok ( n ) => n , Err ( _ ) => { eprintln ! ( " " s ) ; process :: exit ( 1 ) ; } } }
Parses a key with a numeric value; expects that the key is present and has a value.
Parses a key with a numeric value ; expects that the key is present and has a value .
matches
&ArgMatches
key
&str
matches
&ArgMatches
key
&str