Skip to content

Commit

Permalink
update prj
Browse files Browse the repository at this point in the history
  • Loading branch information
zTgx committed Jul 23, 2019
1 parent 099f3e8 commit 69593e7
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/target
**/*.rs.bk
*.lock
Cargo.lock
4 changes: 2 additions & 2 deletions examples/array.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extern crate cast_rs;
use cast_rs::types::array_t;
use cast_rs::array_t;

fn main() {
let arr: &[u8] = &[72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]; //Hello world
Expand All @@ -11,4 +11,4 @@ fn main() {

let v: Vec<u8> = array_t::to_vec(&arr);
assert_eq!(vec![72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100], v);
}
}
4 changes: 2 additions & 2 deletions examples/hex.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
extern crate cast_rs;
use cast_rs::types::hex_t;
use cast_rs::hex_t;

fn main() {
assert_eq!(
hex::decode("48656c6c6f20776f726c6421"),
hex_t::decode("48656c6c6f20776f726c6421"),
Ok("Hello world!".to_owned().into_bytes())
);

Expand Down
2 changes: 1 addition & 1 deletion examples/str.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extern crate cast_rs;
use cast_rs::types::str_t;
use cast_rs::str_t;

fn main() {
let x: &str = "Hello world";
Expand Down
2 changes: 1 addition & 1 deletion examples/string.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extern crate cast_rs;
use cast_rs::types::string_t;
use cast_rs::string_t;

fn main() {
let x: String = "Hello world".to_string();
Expand Down
3 changes: 1 addition & 2 deletions examples/vec.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extern crate cast_rs;
use cast_rs::types::vec_t;
use cast_rs::vec_t;

fn main() {
let v: Vec<u8> = vec![72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100];
Expand All @@ -12,4 +12,3 @@ fn main() {
let array: &[u8] = vec_t::to_array(&v);
assert_eq!([72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100], array);
}

6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
pub mod types;

pub use crate::types::array_t as array_t;
pub use crate::types::hex_t as hex_t;
pub use crate::types::str_t as str_t;
pub use crate::types::string_t as string_t;
pub use crate::types::vec_t as vec_t;
27 changes: 0 additions & 27 deletions src/types/dummy.rs

This file was deleted.

2 changes: 0 additions & 2 deletions src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ pub mod string_t;
pub mod array_t;
pub mod vec_t;
pub mod hex_t;

pub mod dummy;

0 comments on commit 69593e7

Please sign in to comment.