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 authored and axic committed Feb 14, 2019
1 parent b639612 commit dea1323
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
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: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
mod native;
pub mod types;

#[cfg(not(feature = "std"))]
pub mod convert;

#[cfg(feature = "std")]
use std::vec::Vec;

Expand Down

0 comments on commit dea1323

Please sign in to comment.