Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
aurexav committed Dec 31, 2024
1 parent 46ee081 commit 40c32e4
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Here are a few quick examples of the most commonly used operations: hexifying an
However, this crate also offers many other utilities for Array/Bytes/Hex, each with comprehensive documentation and examples. Check them out on [docs.rs](https://docs.rs/array-bytes)!

```rs
use array_bytes::{Hexify, Dehexify};
use array_bytes::{Dehexify, Hexify};
use smallvec::SmallVec;

// Hexify.
Expand All @@ -33,10 +33,7 @@ assert_eq!(5_201_314_usize.hexify_upper(), "4F5DA2");
// `[u8; N]`.
assert_eq!(*b"Love Jane Forever".hexify(), String::from("4c6f7665204a616e6520466f7265766572"));
// `&[u8; N]`.
assert_eq!(
b"Love Jane Forever".hexify_upper(),
String::from("4C6F7665204A616E6520466F7265766572")
);
assert_eq!(b"Love Jane Forever".hexify_upper(), String::from("4C6F7665204A616E6520466F7265766572"));
// `&[u8]`.
assert_eq!(
b"Love Jane Forever".as_slice().hexify_prefixed(),
Expand All @@ -61,10 +58,7 @@ assert_eq!(u64::dehexify("0x4F5DA2"), Ok(5_201_314));
assert_eq!(u128::dehexify("4f5da2"), Ok(5_201_314));
assert_eq!(usize::dehexify("4F5DA2"), Ok(5_201_314));
// Array.
assert_eq!(
<[u8; 17]>::dehexify("0x4c6f7665204a616e6520466f7265766572"),
Ok(*b"Love Jane Forever")
);
assert_eq!(<[u8; 17]>::dehexify("0x4c6f7665204a616e6520466f7265766572"), Ok(*b"Love Jane Forever"));
// SmallVec.
assert_eq!(
SmallVec::dehexify("0x4c6f7665204a616e6520466f7265766572").unwrap().into_vec(),
Expand Down

0 comments on commit 40c32e4

Please sign in to comment.