-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove dummy code & update version to 0.2.1
- Loading branch information
Showing
4 changed files
with
10 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
use cast_rs::hexcast; | ||
use cast_rs::hex; | ||
|
||
fn main() { | ||
assert_eq!( | ||
hexcast::decode("48656c6c6f20776f726c6421"), | ||
Ok("Hello world!".to_owned().into_bytes()) | ||
); | ||
|
||
assert_eq!(hexcast::encode(vec![1, 2, 3, 15, 16]), "0102030f10"); | ||
|
||
assert_eq!(hexcast::encode("Hello world!"), "48656c6c6f20776f726c6421"); | ||
assert_eq!(hex::decode("48656c6c6f20776f726c6421"), Ok("Hello world!".to_owned().into_bytes())); | ||
assert_eq!(hex::encode(vec![1, 2, 3, 15, 16]), "0102030f10"); | ||
assert_eq!(hex::encode("Hello world!"), "48656c6c6f20776f726c6421"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
use cast_rs::slicecast; | ||
use cast_rs::slice_cast; | ||
|
||
fn main() { | ||
let foo: [u8; 4] = [1, 0, 0, 0]; | ||
let bar: &u32 = unsafe { slicecast::cast_to(&foo) }; | ||
let bar: &u32 = unsafe { slice_cast::cast_to(&foo) }; | ||
println!("{}", bar); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
extern crate hex; | ||
extern crate downcast_rs; | ||
extern crate slice_cast; | ||
|
||
pub mod hexcast { | ||
pub use hex::*; | ||
} | ||
|
||
pub mod downcast { | ||
pub use downcast_rs::*; | ||
} | ||
|
||
pub mod slicecast { | ||
pub use slice_cast::*; | ||
} | ||
pub use hex; | ||
pub use downcast_rs; | ||
pub use slice_cast; |