File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,8 +31,6 @@ impl Error {
3131 pub const UNSUPPORTED : Error = internal_error ! ( 0 ) ;
3232 /// The platform-specific `errno` returned a non-positive value.
3333 pub const ERRNO_NOT_POSITIVE : Error = internal_error ! ( 1 ) ;
34- /// Invalid conversion from a non-standard [`std::io::Error`](https://doc.rust-lang.org/std/io/struct.Error.html)
35- pub const UNKNOWN_IO_ERROR : Error = internal_error ! ( 2 ) ;
3634 /// Call to [`SecRandomCopyBytes`](https://developer.apple.com/documentation/security/1399291-secrandomcopybytes) failed.
3735 pub const SEC_RANDOM_FAILED : Error = internal_error ! ( 3 ) ;
3836 /// Call to [`RtlGenRandom`](https://docs.microsoft.com/en-us/windows/win32/api/ntsecapi/nf-ntsecapi-rtlgenrandom) failed.
@@ -157,7 +155,6 @@ fn internal_desc(error: Error) -> Option<&'static str> {
157155 match error {
158156 Error :: UNSUPPORTED => Some ( "getrandom: this target is not supported" ) ,
159157 Error :: ERRNO_NOT_POSITIVE => Some ( "errno: did not return a positive value" ) ,
160- Error :: UNKNOWN_IO_ERROR => Some ( "Unknown std::io::Error" ) ,
161158 Error :: SEC_RANDOM_FAILED => Some ( "SecRandomCopyBytes: call failed" ) ,
162159 Error :: RTL_GEN_RANDOM_FAILED => Some ( "RtlGenRandom: call failed" ) ,
163160 Error :: FAILED_RDRAND => Some ( "RDRAND: failed multiple times: CPU issue likely" ) ,
Original file line number Diff line number Diff line change @@ -12,17 +12,6 @@ use core::convert::From;
1212use core:: num:: NonZeroU32 ;
1313use std:: io;
1414
15- impl From < io:: Error > for Error {
16- fn from ( err : io:: Error ) -> Self {
17- if let Some ( errno) = err. raw_os_error ( ) {
18- if let Some ( code) = NonZeroU32 :: new ( errno as u32 ) {
19- return Error :: from ( code) ;
20- }
21- }
22- Error :: UNKNOWN_IO_ERROR
23- }
24- }
25-
2615impl From < Error > for io:: Error {
2716 fn from ( err : Error ) -> Self {
2817 match err. raw_os_error ( ) {
You can’t perform that action at this time.
0 commit comments