From f681713438e40afd8e70bc51002364ed24656a33 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Mon, 31 Oct 2022 14:30:13 -0300 Subject: [PATCH] Added std to errors and crate --- lets/Cargo.toml | 1 + lets/src/error.rs | 6 ++++++ streams/Cargo.toml | 3 ++- streams/src/error.rs | 6 ++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lets/Cargo.toml b/lets/Cargo.toml index edc961fc..ed9daf70 100644 --- a/lets/Cargo.toml +++ b/lets/Cargo.toml @@ -15,6 +15,7 @@ version = "0.2.0" [features] default = ["utangle-client"] +std = ["spongos/std"] # Enable the IOTA-Tangle transport client (implies `std` features) tangle-client = ["iota-client/async", "futures", "iota-crypto/blake2b"] # Enable the wasm-compatible IOTA-Tangle transport client (incompatile with `tangle-client` feature due to `iota-client/async` using `tokio`. Implies `std` feature) diff --git a/lets/src/error.rs b/lets/src/error.rs index d39e7ea6..317db7d5 100644 --- a/lets/src/error.rs +++ b/lets/src/error.rs @@ -161,3 +161,9 @@ impl From for Error { Self::Request(error) } } + +#[cfg(feature = "std")] +extern crate std; + +#[cfg(feature = "std")] +impl std::error::Error for Error {} \ No newline at end of file diff --git a/streams/Cargo.toml b/streams/Cargo.toml index 7931ea4a..bdcd4e3e 100644 --- a/streams/Cargo.toml +++ b/streams/Cargo.toml @@ -14,7 +14,8 @@ readme = "README.md" version = "0.2.0" [features] -default = ["utangle-client"] +default = ["utangle-client", "std"] +std = ["lets/std", "spongos/std"] did = ["lets/did"] # Enable re-export of uTangle transport client from LETS utangle-client = ["lets/utangle-client"] diff --git a/streams/src/error.rs b/streams/src/error.rs index 4be31fde..0ad93238 100644 --- a/streams/src/error.rs +++ b/streams/src/error.rs @@ -116,3 +116,9 @@ impl From for Error { Self::External(error) } } + +#[cfg(feature = "std")] +extern crate std; + +#[cfg(feature = "std")] +impl std::error::Error for Error {} \ No newline at end of file