We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Debug
Padding
1 parent a6e7563 commit 4c95aeaCopy full SHA for 4c95aea
src/types.rs
@@ -17,6 +17,16 @@ impl<T: Copy> Default for Padding<T> {
17
}
18
19
20
+impl<T: Copy> fmt::Debug for Padding<T> {
21
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
22
+ // Taken frmo `MaybeUninit`'s debug implementation
23
+ // NB: there is no `.pad_fmt` so we can't use a simpler `format_args!("Padding<{..}>").
24
+ let full_name = core::any::type_name::<Self>();
25
+ let prefix_len = full_name.find("Padding").unwrap();
26
+ f.pad(&full_name[prefix_len..])
27
+ }
28
+}
29
+
30
/// The default repr type used for C style enums in Rust.
31
#[cfg(target_env = "msvc")]
32
#[allow(unused)]
0 commit comments