// parses one ECS row in the PERMIT.TXT file
parses one ECS row in the PERMIT.TXT file
parses one ECS row in the PERMIT . TXT file
fn parse_permit(s: &str, key: &str) -> Result<PermitRecord, E> {
    let mut ss = s.split(',');
    let cell_permit = parse_cell_permit(ss.next().ok_or(E::CellPermitTooShort)?, key)?;
    let sli = ss.next().ok_or(E::CellPermitTooShort)?.parse()?;
    let edition = match ss.next().ok_or(E::CellPermitTooShort)? {
        "" => None,
        a => Some(a.parse()?),
    };
    let data_server_id = ss.next().ok_or(E::CellPermitTooShort).map(String::from)?;
    let comment = ss.next().ok_or(E::CellPermitTooShort)?.trim().to_string();
    Ok(PermitRecord {
        cell_permit,
        sli,
        edition,
        data_server_id,
        comment,
    })
}
fn parse_permit ( s : & str , key : & str ) -> Result < PermitRecord , E > { let mut ss = s . split ( ',' ) ; let cell_permit = parse_cell_permit ( ss . next ( ) . ok_or ( E :: CellPermitTooShort ) ? , key ) ? ; let sli = ss . next ( ) . ok_or ( E :: CellPermitTooShort ) ? . parse ( ) ? ; let edition = match ss . next ( ) . ok_or ( E :: CellPermitTooShort ) ? { " " => None , a => Some ( a . parse ( ) ? ) , } ; let data_server_id = ss . next ( ) . ok_or ( E :: CellPermitTooShort ) . map ( String :: from ) ? ; let comment = ss . next ( ) . ok_or ( E :: CellPermitTooShort ) ? . trim ( ) . to_string ( ) ; Ok ( PermitRecord { cell_permit , sli , edition , data_server_id , comment , } ) }
parses one ECS row in the PERMIT.TXT file
parses one ECS row in the PERMIT . TXT file
s
&str
key
&str