Skip to content

Commit dab42bb

Browse files
committed
Use #[serde(rename_all)] instead of listing them all
1 parent 3a6cd74 commit dab42bb

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/cargo/util/config/mod.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,19 +1407,16 @@ pub fn clippy_driver() -> PathBuf {
14071407
}
14081408

14091409
#[derive(Debug, Default, Deserialize, PartialEq)]
1410+
#[serde(rename_all = "kebab-case")]
14101411
pub struct CargoHttpConfig {
14111412
pub proxy: Option<String>,
1412-
#[serde(rename = "low-speed-limit")]
14131413
pub low_speed_limit: Option<u32>,
14141414
pub timeout: Option<u64>,
14151415
pub cainfo: Option<ConfigRelativePath>,
1416-
#[serde(rename = "check-revoke")]
14171416
pub check_revoke: Option<bool>,
1418-
#[serde(rename = "user-agent")]
14191417
pub user_agent: Option<String>,
14201418
pub debug: Option<bool>,
14211419
pub multiplexing: Option<bool>,
1422-
#[serde(rename = "ssl-version")]
14231420
pub ssl_version: Option<SslVersionConfig>,
14241421
}
14251422

@@ -1450,19 +1447,18 @@ pub struct SslVersionConfigRange {
14501447
}
14511448

14521449
#[derive(Debug, Deserialize)]
1450+
#[serde(rename_all = "kebab-case")]
14531451
pub struct CargoNetConfig {
14541452
pub retry: Option<u32>,
14551453
pub offline: Option<bool>,
1456-
#[serde(rename = "git-fetch-with-cli")]
14571454
pub git_fetch_with_cli: Option<bool>,
14581455
}
14591456

14601457
#[derive(Debug, Deserialize)]
1458+
#[serde(rename_all = "kebab-case")]
14611459
pub struct CargoBuildConfig {
14621460
pub pipelining: Option<bool>,
1463-
#[serde(rename = "dep-info-basedir")]
14641461
pub dep_info_basedir: Option<ConfigRelativePath>,
1465-
#[serde(rename = "target-dir")]
14661462
pub target_dir: Option<ConfigRelativePath>,
14671463
pub incremental: Option<bool>,
14681464
pub target: Option<ConfigRelativePath>,

0 commit comments

Comments
 (0)