fn parse_line(line: &str, logger: &Logger) -> Option<Upgrade> {
    let columns: Vec<_> = line.split_whitespace().collect();
    if columns.len() != 6 {
        return None;
    }

    let name = columns[0].to_string();
    let from = columns[1];
    let to = if columns[2].contains("---") {
        columns[3]
    } else {
        columns[2]
    };

    let from = match from.parse::<Version>() {
        Ok(f) => f,
        Err(e) => {
            warn!(logger, "Unable to parse dependency version"; 
                    "crate-name" => name,
                    "from" => from,
                    "error" => e.to_string());
            return None;
        }
    };
    let to = match to.parse::<Version>() {
        Ok(f) => f,
        Err(e) => {
            warn!(logger, "Unable to parse dependency version"; 
                    "crate-name" => name,
                    "to" => to,
                    "error" => e.to_string());
            return None;
        }
    };

    Some(Upgrade { name, from, to })
}
/// Try to parse a single line of output from `cargo outdated`. Errors are
/// logged and ignored.
Try to parse a single line of output from `cargo outdated`. Errors are
logged and ignored.
Try to parse a single line of output from ` cargo outdated ` . Errors are logged and ignored .
fn parse_line(line: &str, logger: &Logger) -> Option<Upgrade> {
    let columns: Vec<_> = line.split_whitespace().collect();
    if columns.len() != 6 {
        return None;
    }
    let name = columns[0].to_string();
    let from = columns[1];
    let to = if columns[2].contains("---") {
        columns[3]
    } else {
        columns[2]
    };
    let from = match from.parse::<Version>() {
        Ok(f) => f,
        Err(e) => {
            warn!(logger, "Unable to parse dependency version"; 
                    "crate-name" => name,
                    "from" => from,
                    "error" => e.to_string());
            return None;
        }
    };
    let to = match to.parse::<Version>() {
        Ok(f) => f,
        Err(e) => {
            warn!(logger, "Unable to parse dependency version"; 
                    "crate-name" => name,
                    "to" => to,
                    "error" => e.to_string());
            return None;
        }
    };
    Some(Upgrade { name, from, to })
}
fn parse_line ( line : & str , logger : & Logger ) -> Option < Upgrade > { let columns : Vec < _ > = line . split_whitespace ( ) . collect ( ) ; if columns . len ( ) != 6 { return None ; } let name = columns [ 0 ] . to_string ( ) ; let from = columns [ 1 ] ; let to = if columns [ 2 ] . contains ( " " ) { columns [ 3 ] } else { columns [ 2 ] } ; let from = match from . parse :: < Version > ( ) { Ok ( f ) => f , Err ( e ) => { warn ! ( logger " " " " name " " from " " e to_string ( ) ) ; return None ; } } ; let to = match to . parse :: < Version > ( ) { Ok ( f ) => f , Err ( e ) => { warn ! ( logger " " " " name " " to " " e to_string ( ) ) ; return None ; } } ; Some ( Upgrade { name , from , to } ) }
Try to parse a single line of output from `cargo outdated`.
Try to parse a single line of output from ` cargo outdated ` .
line
&str
logger
&Logger
line
&str
logger
&Logger