]>
Commit | Line | Data |
---|---|---|
f20569fa XL |
1 | // Copyright 2018 Developers of the Rand project. |
2 | // | |
3 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
4 | // https://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
5 | // <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your | |
6 | // option. This file may not be copied, modified, or distributed | |
7 | // except according to those terms. | |
8 | extern crate std; | |
9 | ||
10 | use crate::Error; | |
11 | use core::convert::From; | |
12 | use std::io; | |
13 | ||
14 | impl From<Error> for io::Error { | |
15 | fn from(err: Error) -> Self { | |
16 | match err.raw_os_error() { | |
17 | Some(errno) => io::Error::from_raw_os_error(errno), | |
18 | None => io::Error::new(io::ErrorKind::Other, err), | |
19 | } | |
20 | } | |
21 | } | |
22 | ||
23 | impl std::error::Error for Error {} |