Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(config): Consistently use kebab-case #13748

Merged
merged 1 commit into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/cargo/ops/cargo_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ impl NewOptions {
}

#[derive(Deserialize)]
#[serde(rename_all = "kebab-case")]
struct CargoNewConfig {
#[deprecated = "cargo-new no longer supports adding the authors field"]
#[allow(dead_code)]
Expand Down
1 change: 1 addition & 0 deletions src/cargo/sources/directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ pub struct DirectorySource<'gctx> {
/// The file name is simply `.cargo-checksum.json`. The checksum algorithm as
/// of now is SHA256.
#[derive(Deserialize)]
#[serde(rename_all = "kebab-case")]
struct Checksum {
/// Checksum of the package. Normally it is computed from the `.crate` file.
package: Option<String>,
Expand Down
1 change: 1 addition & 0 deletions src/cargo/sources/registry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ pub const CRATES_IO_DOMAIN: &str = "crates.io";
/// The content inside `.cargo-ok`.
/// See [`RegistrySource::unpack_package`] for more.
#[derive(Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")]
struct LockMetadata {
/// The version of `.cargo-ok` file
v: u32,
Expand Down
5 changes: 4 additions & 1 deletion src/cargo/util/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2514,6 +2514,7 @@ impl<'de> Deserialize<'de> for SslVersionConfig {
}

#[derive(Clone, Debug, Deserialize, PartialEq)]
#[serde(rename_all = "kebab-case")]
pub struct SslVersionConfigRange {
pub min: Option<String>,
pub max: Option<String>,
Expand Down Expand Up @@ -2644,6 +2645,7 @@ impl BuildTargetConfig {
}

#[derive(Deserialize, Default)]
#[serde(rename_all = "kebab-case")]
pub struct TermConfig {
pub verbose: Option<bool>,
pub quiet: Option<bool>,
Expand All @@ -2656,13 +2658,14 @@ pub struct TermConfig {
}

#[derive(Debug, Default, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct ProgressConfig {
pub when: ProgressWhen,
pub width: Option<usize>,
}

#[derive(Debug, Default, Deserialize)]
#[serde(rename_all = "lowercase")]
#[serde(rename_all = "kebab-case")]
pub enum ProgressWhen {
#[default]
Auto,
Expand Down