Function array_bytes::hex2slice_unchecked

source ·
pub fn hex2slice_unchecked<H>(hex: H, slice: &mut [u8]) -> &[u8]
where H: AsRef<[u8]>,
Expand description

Just like hex2slice but without checking.

§Examples

let mut bytes = [0; 17];

assert_eq!(
	array_bytes::hex2slice_unchecked("0x4c6f7665204a616e6520466f7265766572", &mut bytes),
	b"Love Jane Forever"
);
assert_eq!(bytes, *b"Love Jane Forever");