fn parse_index_value_pair(s: &str) -> Result<(i32, f64)> {
    let tokens: Vec<&str> = s.split(':').collect();
    if tokens.len() == 2 {
        let index = try!(tokens[0].parse().map_err(|_|
                        SvmErr::ParseError(format!("Failed to parse index {}",
                                                  tokens[0]))));
        let value = try!(tokens[1].parse().map_err(|_|
                        SvmErr::ParseError(format!("Failed to parse input variable {}",
                                                  tokens[1]))));
        Ok((index, value))
    } else {
        Err(SvmErr::ParseError(format!("Expected <index>:<value> pair, found {}", s)))
    }
}
/// Parse an <index>:<value> pair from the svm file format. An <index>:<value> pair consists of an
/// i32-valued index and an f64-valued cell value, separated by a colon.
/// Examples: 1:1, 2:2, 3:3.0, 4:-4, 5:-5.5
Parse an : pair from the svm file format. An : pair consists of an
i32-valued index and an f64-valued cell value, separated by a colon.
Parse an : pair from the svm file format . An : pair consists of an i32 - valued index and an f64 - valued cell value separated by a colon .
fn parse_index_value_pair(s: &str) -> Result<(i32, f64)> {
    let tokens: Vec<&str> = s.split(':').collect();
    if tokens.len() == 2 {
        let index = try!(tokens[0].parse().map_err(|_|
                        SvmErr::ParseError(format!("Failed to parse index {}",
                                                  tokens[0]))));
        let value = try!(tokens[1].parse().map_err(|_|
                        SvmErr::ParseError(format!("Failed to parse input variable {}",
                                                  tokens[1]))));
        Ok((index, value))
    } else {
        Err(SvmErr::ParseError(format!("Expected <index>:<value> pair, found {}", s)))
    }
}
fn parse_index_value_pair ( s : & str ) -> Result < ( i32 , f64 ) > { let tokens : Vec < & str > = s . split ( ':' ) . collect ( ) ; if tokens . len ( ) == 2 { let index = try ! ( tokens [ 0 ] parse ( ) map_err ( SvmErr ParseError ( format ( " " tokens [ 0 ] ) ) ) ) ; let value = try ! ( tokens [ 1 ] parse ( ) map_err ( SvmErr ParseError ( format ( " " tokens [ 1 ] ) ) ) ) ; Ok ( ( index , value ) ) } else { Err ( SvmErr :: ParseError ( format ! ( " " s ) ) ) } }
Parse an <index>:<value> pair from the svm file format.
Parse an <index > : <value > pair from the svm file format .
s
&str
s
&str