Skip to content

Commit 955c3bf

Browse files
committed
marker#1
1 parent 709f945 commit 955c3bf

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

Cargo.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,22 @@ name = "cloudevents"
1919
serde = { version = "^1.0", features = ["derive"] }
2020
serde_json = "^1.0"
2121
serde-value = "^0.6"
22+
no_error = "^0.0.2"
2223
chrono = { version = "^0.4", features = ["serde"] }
2324
delegate-attr = "^0.2"
2425
base64 = "^0.12"
2526
url = { version = "^2.1", features = ["serde"] }
2627
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"] }
2838

2939
[target."cfg(not(target_arch = \"wasm32\"))".dependencies]
3040
hostname = "^0.3"

src/event/spec_version.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ impl fmt::Display for UnknownSpecVersion {
5656
}
5757
}
5858

59-
impl std::error::Error for UnknownSpecVersion {}
59+
impl no_error::Error for InvalidSpecVersion {}
6060

6161
impl TryFrom<&str> for SpecVersion {
6262
type Error = UnknownSpecVersion;
6363

64-
fn try_from(value: &str) -> Result<Self, UnknownSpecVersion> {
64+
fn try_from(value: &str) -> core::result::Result<Self, InvalidSpecVersion> {
6565
match value {
6666
"0.3" => Ok(SpecVersion::V03),
6767
"1.0" => Ok(SpecVersion::V10),

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
#![no_std]
2727

2828
extern crate no_std_compat as std;
29+
extern crate no_error;
30+
extern crate core_io;
2931

3032
extern crate serde;
3133
extern crate serde_json;

src/message/error.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use no_error::*;
2+
use core_io::Error;
13
use snafu::Snafu;
24
use std::prelude::v1::*;
35

@@ -32,11 +34,9 @@ pub enum Error {
3234
SerdeJsonError { source: serde_json::Error },
3335
#[snafu(display("IO Error: {}", source))]
3436
#[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> },
4040
}
4141

4242
/// Result type alias for return values during serialization/deserialization process

0 commit comments

Comments
 (0)