diff options
author | ThiƩbaud Weksteen <tweek@google.com> | 2021-03-04 10:20:38 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-03-04 10:20:38 +0000 |
commit | 518a22fe12abbd701061eec546ccd33388a3b7ea (patch) | |
tree | 5d3eb1dcf2b8ee84112e1cda41dda22c0adc720f /src/error_impls.rs | |
parent | 39bbd46163fbcadb5852ff0aba1c19eae2542d38 (diff) | |
parent | c725abe846a01aaf893eaf9286c56c3db8fa180c (diff) | |
download | getrandom-518a22fe12abbd701061eec546ccd33388a3b7ea.tar.gz |
Update to 0.2.2 am: 9791b30a05 am: c725abe846
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/getrandom/+/1614806
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I1a4e2964be5f04f83293703966164236ec402df1
Diffstat (limited to 'src/error_impls.rs')
-rw-r--r-- | src/error_impls.rs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/error_impls.rs b/src/error_impls.rs index 007472e..61f46d2 100644 --- a/src/error_impls.rs +++ b/src/error_impls.rs @@ -5,24 +5,13 @@ // <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. +#![cfg_attr(docsrs, doc(cfg(feature = "std")))] extern crate std; -use crate::{error::UNKNOWN_IO_ERROR, Error}; +use crate::Error; use core::convert::From; -use core::num::NonZeroU32; use std::io; -impl From<io::Error> for Error { - fn from(err: io::Error) -> Self { - if let Some(errno) = err.raw_os_error() { - if let Some(code) = NonZeroU32::new(errno as u32) { - return Error::from(code); - } - } - UNKNOWN_IO_ERROR - } -} - impl From<Error> for io::Error { fn from(err: Error) -> Self { match err.raw_os_error() { |