File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 22//!
33
44use alloc:: string:: String ;
5+ use core:: error;
56use core:: fmt;
67use core:: num:: TryFromIntError ;
78use core:: result;
8- #[ cfg( feature = "std" ) ]
9- use std:: { error, io} ;
10-
119#[ non_exhaustive]
1210#[ derive( Debug ) ]
1311/// A custom Goblin error
@@ -20,15 +18,15 @@ pub enum Error {
2018 Scroll ( scroll:: Error ) ,
2119 /// An IO based error
2220 #[ cfg( feature = "std" ) ]
23- IO ( io:: Error ) ,
21+ IO ( std :: io:: Error ) ,
2422 /// Buffer is too short to hold N items
2523 BufferTooShort ( usize , & ' static str ) ,
2624}
2725
28- #[ cfg( feature = "std" ) ]
2926impl error:: Error for Error {
3027 fn source ( & self ) -> Option < & ( dyn error:: Error + ' static ) > {
3128 match * self {
29+ #[ cfg( feature = "std" ) ]
3230 Error :: IO ( ref io) => Some ( io) ,
3331 Error :: Scroll ( ref scroll) => Some ( scroll) ,
3432 _ => None ,
@@ -37,8 +35,8 @@ impl error::Error for Error {
3735}
3836
3937#[ cfg( feature = "std" ) ]
40- impl From < io:: Error > for Error {
41- fn from ( err : io:: Error ) -> Error {
38+ impl From < std :: io:: Error > for Error {
39+ fn from ( err : std :: io:: Error ) -> Error {
4240 Error :: IO ( err)
4341 }
4442}
You can’t perform that action at this time.
0 commit comments