This patch is based on the upstream commit described below, adapted for use in the Debian package by Peter Michael Green. commit 2736281a647cecb23ae1c17bbaf625b18ebf4b38 Author: Tethys Svensson Date: Mon Dec 20 18:38:16 2021 +0100 Upgrade heck Index: structopt-derive/src/attrs.rs =================================================================== --- --- a/structopt-derive-0.4.18/src/attrs.rs +++ b/structopt-derive-0.4.18/src/attrs.rs @@ -11,7 +11,7 @@ use crate::{parse::*, spanned::Sp, ty::T 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}; @@ -182,7 +182,7 @@ impl CasingStyle { fn from_lit(name: LitStr) -> Sp { 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() { @@ -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, --- a/structopt-derive-0.4.18/Cargo.toml +++ b/structopt-derive-0.4.18/Cargo.toml @@ -24,7 +24,7 @@ repository = "https://github.com/TeXitoi [lib] proc-macro = true [dependencies.heck] -version = "0.3.0" +version = "0.4.0" [dependencies.proc-macro-error] version = "1.0.0"