#![allow(missing_docs)]
use wolfcose::{from_slice_detailed, to_vec, ErrorContext};
fn main() -> wolfcose::Result<()> {
let mut encoded = to_vec(&7u8)?;
encoded.push(0xff);
match from_slice_detailed::<u8>(&encoded) {
Ok(_) => unreachable!("trailing byte should fail"),
Err(err) => {
println!("base error={:?}", err.error);
if let ErrorContext::Cbor(kind) = err.context {
println!("cbor context={kind:?}");
}
}
}
Ok(())
}