]> git.proxmox.com Git - rustc.git/blame - vendor/getrandom/src/error_impls.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / vendor / getrandom / src / error_impls.rs
CommitLineData
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.
8extern crate std;
9
10use crate::Error;
11use core::convert::From;
12use std::io;
13
14impl 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
23impl std::error::Error for Error {}