use crate::core::dependency::DepKind;
use crate::core::registry::PackageRegistry;
-use crate::core::FeatureMap;
use crate::core::FeatureValue;
use crate::core::Package;
use crate::core::QueryKind;
}
}
- fn set_available_features(&mut self, available_features: &FeatureMap) {
- self.available_features = available_features
+ fn apply_summary(&mut self, summary: &Summary) {
+ self.available_features = summary
+ .features()
.iter()
.map(|(k, v)| {
(
fn from(other: &'s Summary) -> Self {
let dep = Dependency::from(other);
let mut dep = Self::new(dep);
- dep.set_available_features(other.features());
+ dep.apply_summary(other);
dep
}
}
.ok_or_else(|| {
anyhow::format_err!("the crate `{dependency}` could not be found in registry index.")
})?;
- dependency.set_available_features(lowest_common_denominator.features());
+ dependency.apply_summary(&lowest_common_denominator);
Ok(dependency)
}