Skip to main content

check_decode

Function check_decode 

Source
pub fn check_decode<T: Decode + Eq + Debug>(bytes: &[u8], expected: &T)
where <T::Decoder as Decoder>::Error: Debug,
Expand description

Checks that the given bytes decode to the expected value, panicking if they don’t.

This is intended for tests only.

§Panics

If the decoded value doesn’t match the expected value, or if decoding fails.