fn expect_failure<T>(n: &[i32], r: io::Result<T>) -> io::Result<()> {
        match r {
            Err(e)
                if n.iter()
                    .map(|n| Option::Some(*n))
                    .any(|n| n == e.raw_os_error()) =>
            {
                Ok(())
            }
            Err(e) => {
                println!("{e} {:?}, {:?}, {:?}", e.raw_os_error(), e.kind(), n);
                Err(e)
            }
            Ok(_) => Err(io::Error::new(
                io::ErrorKind::Other,
                "unexpected success".to_string(),
            )),
        }
    }
/// Expect a particular sort of failure
Expect a particular sort of failure
Expect a particular sort of failure
fn expect_failure<T>(n: &[i32], r: io::Result<T>) -> io::Result<()> {
        match r {
            Err(e)
                if n.iter()
                    .map(|n| Option::Some(*n))
                    .any(|n| n == e.raw_os_error()) =>
            {
                Ok(())
            }
            Err(e) => {
                println!("{e} {:?}, {:?}, {:?}", e.raw_os_error(), e.kind(), n);
                Err(e)
            }
            Ok(_) => Err(io::Error::new(
                io::ErrorKind::Other,
                "unexpected success".to_string(),
            )),
        }
    }
fn expect_failure < T > ( n : & [ i32 ] , r : io :: Result < T > ) -> io :: Result < ( ) > { match r { Err ( e ) if n . iter ( ) . map ( | n | Option :: Some ( * n ) ) . any ( | n | n == e . raw_os_error ( ) ) => { Ok ( ( ) ) } Err ( e ) => { println ! ( " " e raw_os_error ( ) e kind ( ) n ) ; Err ( e ) } Ok ( _ ) => Err ( io :: Error :: new ( io :: ErrorKind :: Other , " " . to_string ( ) , ) ) , } }
Expect a particular sort of failure
Expect a particular sort of failure
n
&[i32]
r
io::Result<T>