Replace match/panic!() boilerplate in codec.rs unit tests with assert_err!() macro.
For context, both of these approaches are superior to using assert!(matches!(_, _)) because it prints the actual value in the cargo test error message if the assertion fails. This new macro simply hides the boilerplate away.
Changed
match
/panic!()
boilerplate incodec.rs
unit tests withassert_err!()
macro.For context, both of these approaches are superior to using
assert!(matches!(_, _))
because it prints the actual value in thecargo test
error message if the assertion fails. This new macro simply hides the boilerplate away.