blob: 19bd48d55a39910f8fd72942c76012e3cf94de4c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
use std::io;
pub trait IntoIOError {
fn ioerr(self) -> io::Error;
}
// This impl bound is taken directly from the io::Error::new function.
impl<E: Into<Box<dyn std::error::Error + Send + Sync>>> IntoIOError for E {
fn ioerr(self) -> io::Error {
io::Error::new(io::ErrorKind::Other, self)
}
}
|