Skip to content

Commit

Permalink
hexlit: Bumped version to 0.5.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
inspier committed Jul 10, 2022
1 parent 5bd84ff commit 8e637a6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hexlit"
version = "0.5.3"
version = "0.5.4"
authors = ["inspier <[email protected]>"]
edition = "2021"
documentation = "https://docs.rs/hexlit"
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A zero-allocation no_std-compatible zero-cost way to convert hex-strings to byte

To add to your Cargo.toml:
```toml
hexlit = "0.5.3"
hexlit = "0.5.4"
```

## Example
Expand All @@ -17,16 +17,20 @@ use hexlit::hex;
fn main() {
const DATA: [u8; 4] = hex!("01020304");
assert_eq!(DATA, [1, 2, 3, 4]);
assert_eq!(hex!("0xDEADBEEF"), [0xDE, 0xAD, 0xBE, 0xEF]);
assert_eq!(hex!("a1b2c3d4"), [0xA1, 0xB2, 0xC3, 0xD4]);
assert_eq!(hex!("E5 E6 90 92"), [0xE5, 0xE6, 0x90, 0x92]);
assert_eq!(hex!("0a0B0C0d"), [10, 11, 12, 13]);
assert_eq!(hex!(1a 0_b 0C 0d), [0x1a, 11, 12, 13]);
assert_eq!(hex!(0F 03|0B|0C|0d), [15, 3, 11, 12, 13]);
assert_eq!(hex!(0A-0B-0C-0d), [10, 11, 12, 13]);
assert_eq!(hex!(
A1 B2
C3
D4
), [0xA1, 0xB2, 0xC3, 0xD4]);
assert_eq!(
hex!(
A1 B2
C3
D4
),
[0xA1, 0xB2, 0xC3, 0xD4]
);
}
```
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
//!
//! const DATA: [u8; 4] = hex!("01020304");
//! assert_eq!(DATA, [1, 2, 3, 4]);
//! assert_eq!(hex!("0xDEADBEEF"), [0xDE, 0xAD, 0xBE, 0xEF]);
//! assert_eq!(hex!("a1b2c3d4"), [0xA1, 0xB2, 0xC3, 0xD4]);
//! assert_eq!(hex!("E5 E6 90 92"), [0xE5, 0xE6, 0x90, 0x92]);
//! assert_eq!(hex!("0a0B0C0d"), [10, 11, 12, 13]);
Expand Down

0 comments on commit 8e637a6

Please sign in to comment.