diff --git a/packed_struct/src/types_num.rs b/packed_struct/src/types_num.rs index 802b5ab..58c4506 100644 --- a/packed_struct/src/types_num.rs +++ b/packed_struct/src/types_num.rs @@ -36,6 +36,12 @@ impl Display for Integer where T: Display { } } +impl fmt::Binary for Integer where T: fmt::Binary { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.num.fmt(f) + } +} + #[cfg(feature = "use_serde")] mod serialize { use serde::ser::{Serialize, Serializer}; @@ -845,4 +851,4 @@ fn test_sign_extension_limits() { assert_eq!(*val, i64::MIN); let val: Integer> = (i64::MAX).into(); assert_eq!(*val, i64::MAX); -} \ No newline at end of file +}