File tree 3 files changed +9
-0
lines changed
3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -2162,4 +2162,10 @@ mod tests {
2162
2162
}
2163
2163
}
2164
2164
}
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
+ }
2165
2171
}
Original file line number Diff line number Diff line change @@ -83,6 +83,8 @@ pub const EXCEPTION_CONTINUE_SEARCH: LONG = 0;
83
83
pub const EXCEPTION_MAXIMUM_PARAMETERS : usize = 15 ;
84
84
pub const EXCEPTION_STACK_OVERFLOW : DWORD = 0xc00000fd ;
85
85
86
+ pub const ERROR_PATH_NOT_FOUND : libc:: c_int = 3 ;
87
+
86
88
#[ repr( C ) ]
87
89
#[ cfg( target_arch = "x86" ) ]
88
90
pub struct WSADATA {
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
51
51
libc:: ERROR_ALREADY_EXISTS => ErrorKind :: AlreadyExists ,
52
52
libc:: ERROR_BROKEN_PIPE => ErrorKind :: BrokenPipe ,
53
53
libc:: ERROR_FILE_NOT_FOUND => ErrorKind :: NotFound ,
54
+ c:: ERROR_PATH_NOT_FOUND => ErrorKind :: NotFound ,
54
55
libc:: ERROR_NO_DATA => ErrorKind :: BrokenPipe ,
55
56
libc:: ERROR_OPERATION_ABORTED => ErrorKind :: TimedOut ,
56
57
You can’t perform that action at this time.
0 commit comments