Skip to content

Commit

Permalink
Use specific methods to add requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Oct 30, 2017
1 parent 8890568 commit abf4122
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cargo/core/resolver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -955,10 +955,10 @@ fn build_requirements<'a, 'b: 'a>(s: &'a Summary, method: &'b Method)
match *method {
Method::Everything => {
for key in s.features().keys() {
reqs.add_feature(key)?;
reqs.require_feature(key)?;
}
for dep in s.dependencies().iter().filter(|d| d.is_optional()) {
reqs.add_feature(dep.name())?;
reqs.require_dependency(dep.name());
}
}
Method::Required { features: requested_features, .. } => {
Expand All @@ -971,7 +971,7 @@ fn build_requirements<'a, 'b: 'a>(s: &'a Summary, method: &'b Method)
Method::Everything |
Method::Required { uses_default_features: true, .. } => {
if s.features().get("default").is_some() {
reqs.add_feature("default")?;
reqs.require_feature("default")?;
}
}
Method::Required { uses_default_features: false, .. } => {}
Expand Down

0 comments on commit abf4122

Please sign in to comment.