Make to_cow_str() for event types public as at least some hedge against unconditional to_string().

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-10-25 02:42:48 +00:00
parent 9f6c48eea2
commit d96d981475

View File

@ -208,7 +208,7 @@ fn generate_enum(
#[allow(deprecated)] #[allow(deprecated)]
impl #ident { impl #ident {
fn to_cow_str(&self) -> ::std::borrow::Cow<'_, ::std::primitive::str> { pub fn to_cow_str(&self) -> ::std::borrow::Cow<'_, ::std::primitive::str> {
match self { match self {
#(#to_cow_str_match_arms,)* #(#to_cow_str_match_arms,)*
Self::_Custom(crate::PrivOwnedStr(s)) => ::std::borrow::Cow::Borrowed(s), Self::_Custom(crate::PrivOwnedStr(s)) => ::std::borrow::Cow::Borrowed(s),