1 2 3 4 5 6 7 8 9
// It'd be convenient to demand TryFrom<u8, Error: core::fmt::Debug>, but RFC 2289 hasn't landed in // stable yet pub trait Code: Into<u8> + core::convert::TryFrom<u8> {} impl Code for u8 {} pub trait OptionNumber: Into<u16> + core::convert::TryFrom<u16> {} impl OptionNumber for u16 {}