@@ -58,33 +58,27 @@ impl From<NoneError> for Error {
58
58
}
59
59
}
60
60
61
- macro_rules! error_impl {
62
- ( $name: ident) => {
63
- pub const $name : Error = Error :: new( concat_idents!( ERR_ , $name) ) ;
64
- } ;
65
- }
66
-
67
61
/// Error implementations
68
62
impl Error {
69
- error_impl ! ( INTERNAL ) ;
70
- error_impl ! ( NOT_SUPPORTED ) ;
71
- error_impl ! ( NO_RESOURCES ) ;
72
- error_impl ! ( NO_MEMORY ) ;
73
- error_impl ! ( INVALID_ARG ) ;
74
- error_impl ! ( BAD_HANDLE ) ;
75
- error_impl ! ( WRONG_TYPE ) ;
76
- error_impl ! ( OUT_OF_BOUNDS ) ;
77
- error_impl ! ( BUFFER_TOO_SMALL ) ;
78
- error_impl ! ( BAD_STATE ) ;
79
- error_impl ! ( TIMED_OUT ) ;
80
- error_impl ! ( SHOULD_WAIT ) ;
81
- error_impl ! ( CANCELLED ) ;
82
- error_impl ! ( PEER_CLOSED ) ;
83
- error_impl ! ( NOT_FOUND ) ;
84
- error_impl ! ( ALREADY_EXISTS ) ;
85
- error_impl ! ( ALREADY_OWNED ) ;
86
- error_impl ! ( UNAVAILABLE ) ;
87
- error_impl ! ( ACCESS_DENIED ) ;
63
+ pub const INTERNAL : Error = Error :: new ( ERR_INTERNAL ) ;
64
+ pub const NOT_SUPPORTED : Error = Error :: new ( ERR_NOT_SUPPORTED ) ;
65
+ pub const NO_RESOURCES : Error = Error :: new ( ERR_NO_RESOURCES ) ;
66
+ pub const NO_MEMORY : Error = Error :: new ( ERR_NO_MEMORY ) ;
67
+ pub const INVALID_ARG : Error = Error :: new ( ERR_INVALID_ARG ) ;
68
+ pub const BAD_HANDLE : Error = Error :: new ( ERR_BAD_HANDLE ) ;
69
+ pub const WRONG_TYPE : Error = Error :: new ( ERR_WRONG_TYPE ) ;
70
+ pub const OUT_OF_BOUNDS : Error = Error :: new ( ERR_OUT_OF_BOUNDS ) ;
71
+ pub const BUFFER_TOO_SMALL : Error = Error :: new ( ERR_BUFFER_TOO_SMALL ) ;
72
+ pub const BAD_STATE : Error = Error :: new ( ERR_BAD_STATE ) ;
73
+ pub const TIMED_OUT : Error = Error :: new ( ERR_TIMED_OUT ) ;
74
+ pub const SHOULD_WAIT : Error = Error :: new ( ERR_SHOULD_WAIT ) ;
75
+ pub const CANCELLED : Error = Error :: new ( ERR_CANCELLED ) ;
76
+ pub const PEER_CLOSED : Error = Error :: new ( ERR_PEER_CLOSED ) ;
77
+ pub const NOT_FOUND : Error = Error :: new ( ERR_NOT_FOUND ) ;
78
+ pub const ALREADY_EXISTS : Error = Error :: new ( ERR_ALREADY_EXISTS ) ;
79
+ pub const ALREADY_OWNED : Error = Error :: new ( ERR_ALREADY_OWNED ) ;
80
+ pub const UNAVAILABLE : Error = Error :: new ( ERR_UNAVAILABLE ) ;
81
+ pub const ACCESS_DENIED : Error = Error :: new ( ERR_ACCESS_DENIED ) ;
88
82
}
89
83
90
84
/// The system encountered an otherwise unspecified error
0 commit comments