File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 5
5
### Changed
6
6
7
7
- Minimum supported Rust version updated to 1.65.0
8
+ - The crate's ` Error ` type can now be converted to a ` std::io::Error ` using ` From ` / ` Into ` .
8
9
9
10
## [ 0.6.1] - 2021-11-22
10
11
Original file line number Diff line number Diff line change @@ -45,3 +45,14 @@ impl convert::From<nix::Error> for Error {
45
45
Error :: Io ( e. into ( ) )
46
46
}
47
47
}
48
+
49
+ impl convert:: From < Error > for io:: Error {
50
+ fn from ( e : Error ) -> io:: Error {
51
+ match e {
52
+ Error :: Io ( err) => err,
53
+ Error :: Unexpected ( err) => io:: Error :: new ( io:: ErrorKind :: Unsupported , err) ,
54
+ Error :: InvalidPath ( err) => io:: Error :: new ( io:: ErrorKind :: InvalidInput , err) ,
55
+ Error :: Unsupported ( err) => io:: Error :: new ( io:: ErrorKind :: InvalidData , err) ,
56
+ }
57
+ }
58
+ }
You can’t perform that action at this time.
0 commit comments