rust-clap-derive-update-dependencies.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. Taken from upstream commit 42f6c72caa7294d5f357e790205b9569b8775f47.
  2. diff --git a/src/attrs.rs b/src/attrs.rs
  3. index b59aa2ee..1f4eaaca 100644
  4. --- a/src/attrs.rs
  5. +++ b/src/attrs.rs
  6. @@ -19,7 +19,7 @@ use crate::{
  7. use std::env;
  8. -use heck::{CamelCase, KebabCase, MixedCase, ShoutySnakeCase, SnakeCase};
  9. +use heck::{ToKebabCase, ToLowerCamelCase, ToShoutySnakeCase, ToSnakeCase, ToUpperCamelCase};
  10. use proc_macro2::{self, Span, TokenStream};
  11. use proc_macro_error::abort;
  12. use quote::{quote, quote_spanned, ToTokens};
  13. @@ -842,7 +842,7 @@ impl CasingStyle {
  14. fn from_lit(name: LitStr) -> Sp<Self> {
  15. use self::CasingStyle::*;
  16. - let normalized = name.value().to_camel_case().to_lowercase();
  17. + let normalized = name.value().to_upper_camel_case().to_lowercase();
  18. let cs = |kind| Sp::new(kind, name.span());
  19. match normalized.as_ref() {
  20. @@ -874,9 +874,9 @@ impl Name {
  21. Name::Derived(ident) => {
  22. let s = ident.unraw().to_string();
  23. let s = match style {
  24. - Pascal => s.to_camel_case(),
  25. + Pascal => s.to_upper_camel_case(),
  26. Kebab => s.to_kebab_case(),
  27. - Camel => s.to_mixed_case(),
  28. + Camel => s.to_lower_camel_case(),
  29. ScreamingSnake => s.to_shouty_snake_case(),
  30. Snake => s.to_snake_case(),
  31. Lower => s.to_snake_case().replace("_", ""),
  32. @@ -896,9 +896,9 @@ impl Name {
  33. Name::Derived(ident) => {
  34. let s = ident.unraw().to_string();
  35. let s = match style {
  36. - Pascal => s.to_camel_case(),
  37. + Pascal => s.to_upper_camel_case(),
  38. Kebab => s.to_kebab_case(),
  39. - Camel => s.to_mixed_case(),
  40. + Camel => s.to_lower_camel_case(),
  41. ScreamingSnake => s.to_shouty_snake_case(),
  42. Snake => s.to_snake_case(),
  43. Lower => s.to_snake_case(),