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 7, 2019
1 parent baa76bb commit de434bf
Show file tree
Hide file tree
Showing 2 changed files with 13 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;
}
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@
/// finish_data(&a.bytes);
/// }
/// ```

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 de434bf

Please sign in to comment.