diff --git a/sdk/src/types/block/capabilities.rs b/sdk/src/types/block/capabilities.rs index 6c8f06d740..bf2d93ded5 100644 --- a/sdk/src/types/block/capabilities.rs +++ b/sdk/src/types/block/capabilities.rs @@ -32,7 +32,7 @@ impl From for CapabilityError { } /// A list of bitflags that represent capabilities. -#[derive(Debug, Deref)] +#[derive(Deref)] #[repr(transparent)] pub struct Capabilities { #[deref] @@ -58,6 +58,12 @@ impl Capabilities { } } +impl core::fmt::Debug for Capabilities { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + f.debug_list().entries(self.capabilities_iter()).finish() + } +} + impl Capabilities { /// Try to create capabilities from serialized bytes. Bytes with trailing zeroes are invalid. pub fn from_bytes(bytes: impl Into>) -> Result { @@ -234,7 +240,7 @@ impl Packable for Capabilities { } } -pub trait CapabilityFlag { +pub trait CapabilityFlag: core::fmt::Debug { type Iterator: Iterator; /// Converts the flag into the byte representation.