@@ -8,9 +8,6 @@ use core::fmt;
8
8
#[ cfg( feature = "alloc" ) ]
9
9
extern crate alloc;
10
10
11
- #[ cfg( feature = "std" ) ]
12
- pub mod adapters;
13
-
14
11
mod impls;
15
12
16
13
/// Enumeration of possible methods to seek within an I/O object.
@@ -26,6 +23,30 @@ pub enum SeekFrom {
26
23
Current ( i64 ) ,
27
24
}
28
25
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
+
29
50
#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
30
51
#[ non_exhaustive]
31
52
/// Possible kinds of errors.
@@ -165,6 +186,14 @@ impl Error for ErrorKind {
165
186
}
166
187
}
167
188
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
+
168
197
/// Base trait for all IO traits, defining the error type.
169
198
///
170
199
/// All IO operations of all traits return the error defined in this trait.
0 commit comments