Tweak Debug representation of custom tokens
For example given:
custom_keyword!(interface);
custom_punctuation!(Spaceship, <=>);
struct Demo {
keyword: Token![struct],
punct: Token![=>],
custom_keyword: kw::interface,
custom_punct: Spaceship,
}
The Debug would be:
Demo {
keyword: Struct,
punct: FatArrow,
custom_keyword: Keyword [interface],
custom_punct: Spaceship,
}
diff --git a/src/custom_punctuation.rs b/src/custom_punctuation.rs
index 72ce21d..a05e18c 100644
--- a/src/custom_punctuation.rs
+++ b/src/custom_punctuation.rs
@@ -188,12 +188,12 @@
// Not public API.
#[cfg(feature = "extra-traits")]
#[doc(hidden)]
-#[macro_export(local_inner_macros)]
+#[macro_export]
macro_rules! impl_extra_traits_for_custom_punctuation {
($ident:ident, $($tt:tt)+) => {
impl $crate::export::Debug for $ident {
fn fmt(&self, f: &mut $crate::export::Formatter) -> $crate::export::fmt::Result {
- $crate::export::Formatter::write_str(f, stringify_punct!($($tt)+))
+ $crate::export::Formatter::write_str(f, stringify!($ident))
}
}