12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- Taken from upstream commit 42f6c72caa7294d5f357e790205b9569b8775f47.
- diff --git a/src/attrs.rs b/src/attrs.rs
- index b59aa2ee..1f4eaaca 100644
- --- a/src/attrs.rs
- +++ b/src/attrs.rs
- @@ -19,7 +19,7 @@ use crate::{
-
- use std::env;
-
- -use heck::{CamelCase, KebabCase, MixedCase, ShoutySnakeCase, SnakeCase};
- +use heck::{ToKebabCase, ToLowerCamelCase, ToShoutySnakeCase, ToSnakeCase, ToUpperCamelCase};
- use proc_macro2::{self, Span, TokenStream};
- use proc_macro_error::abort;
- use quote::{quote, quote_spanned, ToTokens};
- @@ -842,7 +842,7 @@ impl CasingStyle {
- fn from_lit(name: LitStr) -> Sp<Self> {
- use self::CasingStyle::*;
-
- - let normalized = name.value().to_camel_case().to_lowercase();
- + let normalized = name.value().to_upper_camel_case().to_lowercase();
- let cs = |kind| Sp::new(kind, name.span());
-
- match normalized.as_ref() {
- @@ -874,9 +874,9 @@ impl Name {
- Name::Derived(ident) => {
- let s = ident.unraw().to_string();
- let s = match style {
- - Pascal => s.to_camel_case(),
- + Pascal => s.to_upper_camel_case(),
- Kebab => s.to_kebab_case(),
- - Camel => s.to_mixed_case(),
- + Camel => s.to_lower_camel_case(),
- ScreamingSnake => s.to_shouty_snake_case(),
- Snake => s.to_snake_case(),
- Lower => s.to_snake_case().replace("_", ""),
- @@ -896,9 +896,9 @@ impl Name {
- Name::Derived(ident) => {
- let s = ident.unraw().to_string();
- let s = match style {
- - Pascal => s.to_camel_case(),
- + Pascal => s.to_upper_camel_case(),
- Kebab => s.to_kebab_case(),
- - Camel => s.to_mixed_case(),
- + Camel => s.to_lower_camel_case(),
- ScreamingSnake => s.to_shouty_snake_case(),
- Snake => s.to_snake_case(),
- Lower => s.to_snake_case(),
|