File tree Expand file tree Collapse file tree 4 files changed +20
-8
lines changed Expand file tree Collapse file tree 4 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,22 @@ name = "cloudevents"
19
19
serde = { version = " ^1.0" , features = [" derive" ] }
20
20
serde_json = " ^1.0"
21
21
serde-value = " ^0.6"
22
+ no_error = " ^0.0.2"
22
23
chrono = { version = " ^0.4" , features = [" serde" ] }
23
24
delegate-attr = " ^0.2"
24
25
base64 = " ^0.12"
25
26
url = { version = " ^2.1" , features = [" serde" ] }
26
27
snafu = " ^0.6"
27
- no-std-compat = { version = " ^0.4.1" , features = [" alloc" ] }
28
+
29
+ [dependencies .no-std-compat ]
30
+ rand = { git = " https://gitlab.com/jD91mZM2/no-std-compat.git" }
31
+ features = [" alloc" ] # ,"compat_hash"]
32
+
33
+
34
+ [dependencies .core_io ]
35
+ rand = { git = " https://github.com/jethrogb/rust-core_io" }
36
+
37
+ # no-std-compat = { version = "^0.4.1", features = ["alloc"] }
28
38
29
39
[target ."cfg(not(target_arch = \"wasm32\"))" .dependencies ]
30
40
hostname = " ^0.3"
Original file line number Diff line number Diff line change @@ -56,12 +56,12 @@ impl fmt::Display for UnknownSpecVersion {
56
56
}
57
57
}
58
58
59
- impl std :: error :: Error for UnknownSpecVersion { }
59
+ impl no_error :: Error for InvalidSpecVersion { }
60
60
61
61
impl TryFrom < & str > for SpecVersion {
62
62
type Error = UnknownSpecVersion ;
63
63
64
- fn try_from ( value : & str ) -> Result < Self , UnknownSpecVersion > {
64
+ fn try_from ( value : & str ) -> core :: result :: Result < Self , InvalidSpecVersion > {
65
65
match value {
66
66
"0.3" => Ok ( SpecVersion :: V03 ) ,
67
67
"1.0" => Ok ( SpecVersion :: V10 ) ,
Original file line number Diff line number Diff line change 26
26
#![ no_std]
27
27
28
28
extern crate no_std_compat as std;
29
+ extern crate no_error;
30
+ extern crate core_io;
29
31
30
32
extern crate serde;
31
33
extern crate serde_json;
Original file line number Diff line number Diff line change
1
+ use no_error:: * ;
2
+ use core_io:: Error ;
1
3
use snafu:: Snafu ;
2
4
use std:: prelude:: v1:: * ;
3
5
@@ -32,11 +34,9 @@ pub enum Error {
32
34
SerdeJsonError { source : serde_json:: Error } ,
33
35
#[ snafu( display( "IO Error: {}" , source) ) ]
34
36
#[ snafu( context( false ) ) ]
35
- IOError { source : std:: io:: Error } ,
36
- #[ snafu( display( "Other error: {}" , source) ) ]
37
- Other {
38
- source : Box < dyn std:: error:: Error + Send + Sync > ,
39
- } ,
37
+ IOError { source : core_io:: Error } ,
38
+ #[ snafu( display( "Other error: {:#?}" , source) ) ]
39
+ Other { source : Box < dyn std:: error:: Error > } ,
40
40
}
41
41
42
42
/// Result type alias for return values during serialization/deserialization process
You can’t perform that action at this time.
0 commit comments