Simplify Debug representation of Ident
diff --git a/src/stable.rs b/src/stable.rs
index 62dc670..8091415 100644
--- a/src/stable.rs
+++ b/src/stable.rs
@@ -515,12 +515,23 @@
}
impl fmt::Debug for Ident {
+ // Ident(proc_macro), Ident(r#union)
+ #[cfg(not(procmacro2_semver_exempt))]
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ let mut debug = f.debug_tuple("Ident");
+ debug.field(&format_args!("{}", self));
+ debug.finish()
+ }
+
+ // Ident {
+ // sym: proc_macro,
+ // span: bytes(128..138)
+ // }
+ #[cfg(procmacro2_semver_exempt)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let mut debug = f.debug_struct("Ident");
- debug.field("sym", &format_args!("{}", self.as_str()));
- #[cfg(procmacro2_semver_exempt)]
+ debug.field("sym", &format_args!("{}", self));
debug.field("span", &self.span);
- debug.field("raw", &self.raw);
debug.finish()
}
}