Skip to content

Commit

Permalink
Upgrade heck
Browse files Browse the repository at this point in the history
  • Loading branch information
TethysSvensson authored and TeXitoi committed Dec 21, 2021
1 parent 358cccf commit 2736281
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion structopt-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ travis-ci = { repository = "TeXitoi/structopt" }
syn = { version = "1", features = ["full"] }
quote = "1"
proc-macro2 = "1"
heck = "0.3.0"
heck = "0.4.0"
proc-macro-error = "1.0.0"

[features]
Expand Down
8 changes: 4 additions & 4 deletions structopt-derive/src/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{parse::*, spanned::Sp, ty::Ty};

use std::env;

use heck::{CamelCase, KebabCase, MixedCase, ShoutySnakeCase, SnakeCase};
use heck::{ToKebabCase, ToLowerCamelCase, ToShoutySnakeCase, ToSnakeCase, ToUpperCamelCase};
use proc_macro2::{Span, TokenStream};
use proc_macro_error::abort;
use quote::{quote, quote_spanned, ToTokens};
Expand Down Expand Up @@ -182,7 +182,7 @@ impl CasingStyle {
fn from_lit(name: LitStr) -> Sp<Self> {
use 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 All @@ -208,9 +208,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(),
Verbatim => s,
Expand Down

0 comments on commit 2736281

Please sign in to comment.