ystd 0.0.11

An opinionated and batteries included `std` mirror for convenient, correct code and pleasant error messages
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
pub use hex::*;

use crate::error::{ReportedError, WrapReportedErr};
use crate::prelude::*;

#[instrument(name = "ystd::hex::decode")]
pub fn decode<T: AsRef<[u8]> + core::fmt::Debug>(
	input: T,
) -> Result<Vec<u8>, ReportedError<FromHexError>> {
	::hex::decode(input)
		.map_err(ReportedError::new)
		.wrap_reported_err("Couldn't decode hex encoded data")
}