From d96d9814754ec45c148d77e5241bbdf14b323b8a Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 25 Oct 2024 02:42:48 +0000 Subject: [PATCH] Make to_cow_str() for event types public as at least some hedge against unconditional to_string(). Signed-off-by: Jason Volk --- crates/ruma-macros/src/events/event_type.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ruma-macros/src/events/event_type.rs b/crates/ruma-macros/src/events/event_type.rs index b18ac0dd..df49bfa8 100644 --- a/crates/ruma-macros/src/events/event_type.rs +++ b/crates/ruma-macros/src/events/event_type.rs @@ -208,7 +208,7 @@ fn generate_enum( #[allow(deprecated)] 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 { #(#to_cow_str_match_arms,)* Self::_Custom(crate::PrivOwnedStr(s)) => ::std::borrow::Cow::Borrowed(s),