Make schema_name() return Cow<'static, str> instead of String

This commit is contained in:
Graham Esau 2024-05-26 15:20:56 +01:00
parent fe05631f21
commit 1aaa162e0b
25 changed files with 126 additions and 157 deletions

View file

@ -114,8 +114,8 @@ fn type_for_schema(with_attr: &WithAttr) -> (syn::Type, Option<TokenStream>) {
false
}
fn schema_name() -> std::string::String {
#fn_name.to_string()
fn schema_name() -> std::borrow::Cow<'static, str> {
std::borrow::Cow::Borrowed(#fn_name)
}
fn schema_id() -> std::borrow::Cow<'static, str> {