How can I match on a specific io::Error type?

This works in Rust version 1.17.0 (and probably back to Rust 1.0):

let binary = match file.read_u16::<BigEndian>() {
    Err(ref e) if e.kind() == std::io::ErrorKind::UnexpectedEof => break,
    Err(e) => panic!("Can't read from file: {}, err {}", filename, e),
    Ok(binary) => binary,
};

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)