Skip to content

Commit 761e7bb

Browse files
committed
Add type conversion traits in case no_std is enabled
1 parent ffe914e commit 761e7bb

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/convert.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
use super::*;
2+
3+
pub trait From<T>: Sized {
4+
fn from(_: T) -> Self;
5+
}
6+
7+
pub trait Into<T>: Sized {
8+
fn from(self) -> T;
9+
}

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#[cfg(not(feature = "std"))]
2+
pub mod convert;
13
/// ewasm_api is a library used to interface with Ethereum's EEI in Ewasm, a set of enhancements to
24
/// the Ethereum smart contract platform.
35
/// ewasm_api exposes both a set of unsafe "native" functions representing the actual EEI
@@ -18,7 +20,6 @@
1820
/// finish_data(&a.bytes);
1921
/// }
2022
/// ```
21-
2223
pub mod types;
2324

2425
mod native;

0 commit comments

Comments
 (0)