@@ -8,9 +8,6 @@ use core::fmt;
88#[ cfg( feature = "alloc" ) ]
99extern crate alloc;
1010
11- #[ cfg( feature = "std" ) ]
12- pub mod adapters;
13-
1411mod impls;
1512
1613/// Enumeration of possible methods to seek within an I/O object.
@@ -26,6 +23,30 @@ pub enum SeekFrom {
2623 Current ( i64 ) ,
2724}
2825
26+ #[ cfg( feature = "std" ) ]
27+ #[ cfg_attr( docsrs, doc( cfg( feature = "std" ) ) ) ]
28+ impl From < SeekFrom > for std:: io:: SeekFrom {
29+ fn from ( pos : SeekFrom ) -> Self {
30+ match pos {
31+ SeekFrom :: Start ( n) => std:: io:: SeekFrom :: Start ( n) ,
32+ SeekFrom :: End ( n) => std:: io:: SeekFrom :: End ( n) ,
33+ SeekFrom :: Current ( n) => std:: io:: SeekFrom :: Current ( n) ,
34+ }
35+ }
36+ }
37+
38+ #[ cfg( feature = "std" ) ]
39+ #[ cfg_attr( docsrs, doc( cfg( feature = "std" ) ) ) ]
40+ impl From < std:: io:: SeekFrom > for SeekFrom {
41+ fn from ( pos : std:: io:: SeekFrom ) -> SeekFrom {
42+ match pos {
43+ std:: io:: SeekFrom :: Start ( n) => SeekFrom :: Start ( n) ,
44+ std:: io:: SeekFrom :: End ( n) => SeekFrom :: End ( n) ,
45+ std:: io:: SeekFrom :: Current ( n) => SeekFrom :: Current ( n) ,
46+ }
47+ }
48+ }
49+
2950#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
3051#[ non_exhaustive]
3152/// Possible kinds of errors.
@@ -165,6 +186,14 @@ impl Error for ErrorKind {
165186 }
166187}
167188
189+ #[ cfg( feature = "std" ) ]
190+ #[ cfg_attr( docsrs, doc( cfg( feature = "std" ) ) ) ]
191+ impl crate :: Error for std:: io:: Error {
192+ fn kind ( & self ) -> crate :: ErrorKind {
193+ self . kind ( ) . into ( )
194+ }
195+ }
196+
168197/// Base trait for all IO traits, defining the error type.
169198///
170199/// All IO operations of all traits return the error defined in this trait.
0 commit comments