Skip to content

Commit

Permalink
Add type conversion traits in case no_std is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelang committed Jan 27, 2019
1 parent ffe914e commit 761e7bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/convert.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use super::*;

pub trait From<T>: Sized {
fn from(_: T) -> Self;
}

pub trait Into<T>: Sized {
fn from(self) -> T;
}
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#[cfg(not(feature = "std"))]
pub mod convert;
/// ewasm_api is a library used to interface with Ethereum's EEI in Ewasm, a set of enhancements to
/// the Ethereum smart contract platform.
/// ewasm_api exposes both a set of unsafe "native" functions representing the actual EEI
Expand All @@ -18,7 +20,6 @@
/// finish_data(&a.bytes);
/// }
/// ```

pub mod types;

mod native;
Expand Down

0 comments on commit 761e7bb

Please sign in to comment.