Skip to content

Commit

Permalink
Accept default_features for default-features
Browse files Browse the repository at this point in the history
This was accepted by this historical TOML parser, so we'll need to preserve this
ability.

Closes #3768
  • Loading branch information
alexcrichton committed Feb 27, 2017
1 parent 8a15098 commit fd25593
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cargo/util/toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ pub struct DetailedTomlDependency {
optional: Option<bool>,
#[serde(rename = "default-features")]
default_features: Option<bool>,
#[serde(rename = "default_features")]
default_features2: Option<bool>,
}

#[derive(Deserialize)]
Expand Down Expand Up @@ -947,7 +949,9 @@ impl TomlDependency {
None => DependencyInner::parse(name, version, &new_source_id, None)?,
};
dep = dep.set_features(details.features.unwrap_or(Vec::new()))
.set_default_features(details.default_features.unwrap_or(true))
.set_default_features(details.default_features
.or(details.default_features2)
.unwrap_or(true))
.set_optional(details.optional.unwrap_or(false))
.set_platform(cx.platform.clone());
if let Some(kind) = kind {
Expand Down

0 comments on commit fd25593

Please sign in to comment.