Function array_bytes::hex_into_unchecked
source · pub fn hex_into_unchecked<H, T>(hex: H) -> Twhere
H: AsRef<[u8]>,
T: From<Vec<u8>>,
Expand description
Just like hex_into
but without the checking.
Examples
#[derive(Debug, PartialEq)]
struct LJF(Vec<u8>);
impl From<Vec<u8>> for LJF {
fn from(vec: Vec<u8>) -> Self {
Self(vec)
}
}
assert_eq!(
array_bytes::hex_into_unchecked::<_, LJF>("0x4c6f7665204a616e6520466f7265766572"),
LJF(b"Love Jane Forever".to_vec())
);