diff --git a/argh_derive/Cargo.toml b/argh_derive/Cargo.toml index 0c9eb8e..2294c70 100644 --- a/argh_derive/Cargo.toml +++ b/argh_derive/Cargo.toml @@ -12,7 +12,7 @@ readme = "README.md" proc-macro = true [dependencies] -heck = "0.3.1" +heck = "0.4" proc-macro2 = "1.0" quote = "1.0" syn = "1.0" diff --git a/argh_derive/src/lib.rs b/argh_derive/src/lib.rs index 2e5f1ec..7dc5f32 100644 --- a/argh_derive/src/lib.rs +++ b/argh_derive/src/lib.rs @@ -13,6 +13,7 @@ use { errors::Errors, parse_attrs::{FieldAttrs, FieldKind, TypeAttrs}, }, + heck::ToKebabCase, proc_macro2::{Span, TokenStream}, quote::{quote, quote_spanned, ToTokens}, std::{collections::HashMap, str::FromStr}, @@ -184,7 +185,7 @@ impl<'a> StructField<'a> { .long .as_ref() .map(syn::LitStr::value) - .unwrap_or_else(|| heck::KebabCase::to_kebab_case(&*name.to_string())); + .unwrap_or_else(|| name.to_string().to_kebab_case()); if long_name == "help" { errors.err(field, "Custom `--help` flags are not supported."); }