File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -2162,4 +2162,10 @@ mod tests {
21622162 }
21632163 }
21642164 }
2165+
2166+ #[ test]
2167+ fn read_dir_not_found ( ) {
2168+ let res = fs:: read_dir ( "/path/that/does/not/exist" ) ;
2169+ assert_eq ! ( res. err( ) . unwrap( ) . kind( ) , ErrorKind :: NotFound ) ;
2170+ }
21652171}
Original file line number Diff line number Diff line change @@ -83,6 +83,8 @@ pub const EXCEPTION_CONTINUE_SEARCH: LONG = 0;
8383pub const EXCEPTION_MAXIMUM_PARAMETERS : usize = 15 ;
8484pub const EXCEPTION_STACK_OVERFLOW : DWORD = 0xc00000fd ;
8585
86+ pub const ERROR_PATH_NOT_FOUND : libc:: c_int = 3 ;
87+
8688#[ repr( C ) ]
8789#[ cfg( target_arch = "x86" ) ]
8890pub struct WSADATA {
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
5151 libc:: ERROR_ALREADY_EXISTS => ErrorKind :: AlreadyExists ,
5252 libc:: ERROR_BROKEN_PIPE => ErrorKind :: BrokenPipe ,
5353 libc:: ERROR_FILE_NOT_FOUND => ErrorKind :: NotFound ,
54+ c:: ERROR_PATH_NOT_FOUND => ErrorKind :: NotFound ,
5455 libc:: ERROR_NO_DATA => ErrorKind :: BrokenPipe ,
5556 libc:: ERROR_OPERATION_ABORTED => ErrorKind :: TimedOut ,
5657
You can’t perform that action at this time.
0 commit comments