Skip to content

Commit

Permalink
Keep track of whether manifest overrides workspace dependency's defau…
Browse files Browse the repository at this point in the history
…lt-features
  • Loading branch information
dtolnay committed Jul 31, 2024
1 parent a4f4171 commit fa107d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions src/dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ pub(crate) struct Dependency {
pub path: Option<Directory>,
#[serde(default, skip_serializing_if = "is_false")]
pub optional: bool,
#[serde(rename = "default-features", default = "get_true")]
pub default_features: bool,
#[serde(rename = "default-features", skip_serializing_if = "Option::is_none")]
pub default_features: Option<bool>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub features: Vec<String>,
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -187,10 +187,6 @@ pub(crate) struct Patch {
pub rest: Map<String, Value>,
}

fn get_true() -> bool {
true
}

fn is_false(boolean: &bool) -> bool {
!*boolean
}
Expand Down Expand Up @@ -269,7 +265,7 @@ impl<'de> Deserialize<'de> for Dependency {
version: Some(s.to_owned()),
path: None,
optional: false,
default_features: true,
default_features: Some(true),
features: Vec::new(),
git: None,
branch: None,
Expand Down
2 changes: 1 addition & 1 deletion src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ impl Runner {
version: None,
path: Some(source_dir.clone()),
optional: false,
default_features: false,
default_features: Some(false),
features: Vec::new(),
git: None,
branch: None,
Expand Down

0 comments on commit fa107d6

Please sign in to comment.