Skip to content

Commit

Permalink
Merge pull request #3240 from epage/heck
Browse files Browse the repository at this point in the history
chore: Upgrade heck
  • Loading branch information
epage committed Jan 2, 2022
2 parents 3bb3338 + 42f6c72 commit 879219a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion clap_derive/Cargo.toml
Expand Up @@ -34,7 +34,7 @@ bench = false
syn = { version = "1.0.74", features = ["full"] }
quote = "1.0.9"
proc-macro2 = "1.0.28"
heck = "0.3.0"
heck = "0.4.0"
proc-macro-error = "1"

[features]
Expand Down
12 changes: 6 additions & 6 deletions clap_derive/src/attrs.rs
Expand Up @@ -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};
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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("_", ""),
Expand All @@ -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(),
Expand Down

0 comments on commit 879219a

Please sign in to comment.