common: Use quoted string as Debug representation of event types
This commit is contained in:
parent
3a722965f5
commit
7de5893b83
@ -194,7 +194,7 @@ fn generate_enum(
|
||||
/// This type can hold an arbitrary string. To build events with a custom type, convert it
|
||||
/// from a string with `::from() / .into()`. To check for events that are not available as a
|
||||
/// documented variant here, use its string representation, obtained through `.to_string()`.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
pub enum #ident {
|
||||
#(
|
||||
@ -222,6 +222,13 @@ fn generate_enum(
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
impl ::std::fmt::Debug for #ident {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||
<str as ::std::fmt::Debug>::fmt(&self.to_cow_str(), f)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
impl ::std::convert::From<&::std::primitive::str> for #ident {
|
||||
fn from(s: &::std::primitive::str) -> Self {
|
||||
|
Loading…
x
Reference in New Issue
Block a user