File tree 2 files changed +0
-14
lines changed
2 files changed +0
-14
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,6 @@ impl Error {
31
31
pub const UNSUPPORTED : Error = internal_error ! ( 0 ) ;
32
32
/// The platform-specific `errno` returned a non-positive value.
33
33
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 ) ;
36
34
/// Call to [`SecRandomCopyBytes`](https://developer.apple.com/documentation/security/1399291-secrandomcopybytes) failed.
37
35
pub const SEC_RANDOM_FAILED : Error = internal_error ! ( 3 ) ;
38
36
/// 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> {
157
155
match error {
158
156
Error :: UNSUPPORTED => Some ( "getrandom: this target is not supported" ) ,
159
157
Error :: ERRNO_NOT_POSITIVE => Some ( "errno: did not return a positive value" ) ,
160
- Error :: UNKNOWN_IO_ERROR => Some ( "Unknown std::io::Error" ) ,
161
158
Error :: SEC_RANDOM_FAILED => Some ( "SecRandomCopyBytes: call failed" ) ,
162
159
Error :: RTL_GEN_RANDOM_FAILED => Some ( "RtlGenRandom: call failed" ) ,
163
160
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;
12
12
use core:: num:: NonZeroU32 ;
13
13
use std:: io;
14
14
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
-
26
15
impl From < Error > for io:: Error {
27
16
fn from ( err : Error ) -> Self {
28
17
match err. raw_os_error ( ) {
You can’t perform that action at this time.
0 commit comments