mirror of https://github.com/rust-lang/cargo
refactor(config): Consistently use kebab-case
This shouldn't change the behavior but makes it safer if - We add new fields where it will matter - Copy/paste these for new structs I did not change things related to the Index because we are already stuck with that case (whether we want it or not)
This commit is contained in:
parent
91796b1828
commit
bb46cce363
|
@ -131,6 +131,7 @@ impl NewOptions {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
|
#[serde(rename_all = "kebab-case")]
|
||||||
struct CargoNewConfig {
|
struct CargoNewConfig {
|
||||||
#[deprecated = "cargo-new no longer supports adding the authors field"]
|
#[deprecated = "cargo-new no longer supports adding the authors field"]
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
|
|
|
@ -70,6 +70,7 @@ pub struct DirectorySource<'gctx> {
|
||||||
/// The file name is simply `.cargo-checksum.json`. The checksum algorithm as
|
/// The file name is simply `.cargo-checksum.json`. The checksum algorithm as
|
||||||
/// of now is SHA256.
|
/// of now is SHA256.
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
|
#[serde(rename_all = "kebab-case")]
|
||||||
struct Checksum {
|
struct Checksum {
|
||||||
/// Checksum of the package. Normally it is computed from the `.crate` file.
|
/// Checksum of the package. Normally it is computed from the `.crate` file.
|
||||||
package: Option<String>,
|
package: Option<String>,
|
||||||
|
|
|
@ -227,6 +227,7 @@ pub const CRATES_IO_DOMAIN: &str = "crates.io";
|
||||||
/// The content inside `.cargo-ok`.
|
/// The content inside `.cargo-ok`.
|
||||||
/// See [`RegistrySource::unpack_package`] for more.
|
/// See [`RegistrySource::unpack_package`] for more.
|
||||||
#[derive(Deserialize, Serialize)]
|
#[derive(Deserialize, Serialize)]
|
||||||
|
#[serde(rename_all = "kebab-case")]
|
||||||
struct LockMetadata {
|
struct LockMetadata {
|
||||||
/// The version of `.cargo-ok` file
|
/// The version of `.cargo-ok` file
|
||||||
v: u32,
|
v: u32,
|
||||||
|
|
|
@ -2514,6 +2514,7 @@ impl<'de> Deserialize<'de> for SslVersionConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq)]
|
#[derive(Clone, Debug, Deserialize, PartialEq)]
|
||||||
|
#[serde(rename_all = "kebab-case")]
|
||||||
pub struct SslVersionConfigRange {
|
pub struct SslVersionConfigRange {
|
||||||
pub min: Option<String>,
|
pub min: Option<String>,
|
||||||
pub max: Option<String>,
|
pub max: Option<String>,
|
||||||
|
@ -2644,6 +2645,7 @@ impl BuildTargetConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Default)]
|
#[derive(Deserialize, Default)]
|
||||||
|
#[serde(rename_all = "kebab-case")]
|
||||||
pub struct TermConfig {
|
pub struct TermConfig {
|
||||||
pub verbose: Option<bool>,
|
pub verbose: Option<bool>,
|
||||||
pub quiet: Option<bool>,
|
pub quiet: Option<bool>,
|
||||||
|
@ -2656,13 +2658,14 @@ pub struct TermConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Deserialize)]
|
#[derive(Debug, Default, Deserialize)]
|
||||||
|
#[serde(rename_all = "kebab-case")]
|
||||||
pub struct ProgressConfig {
|
pub struct ProgressConfig {
|
||||||
pub when: ProgressWhen,
|
pub when: ProgressWhen,
|
||||||
pub width: Option<usize>,
|
pub width: Option<usize>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Deserialize)]
|
#[derive(Debug, Default, Deserialize)]
|
||||||
#[serde(rename_all = "lowercase")]
|
#[serde(rename_all = "kebab-case")]
|
||||||
pub enum ProgressWhen {
|
pub enum ProgressWhen {
|
||||||
#[default]
|
#[default]
|
||||||
Auto,
|
Auto,
|
||||||
|
|
Loading…
Reference in New Issue