From 85f6d2d7efde2ae1e5a6052fad5c78ed97045246 Mon Sep 17 00:00:00 2001 From: Jacob Finkelman Date: Wed, 19 Jun 2024 19:26:38 +0000 Subject: [PATCH] tweek names to be clearer --- src/cargo/core/summary.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/cargo/core/summary.rs b/src/cargo/core/summary.rs index b5bc086ca47..18eaa16a0a7 100644 --- a/src/cargo/core/summary.rs +++ b/src/cargo/core/summary.rs @@ -179,7 +179,7 @@ fn build_feature_map( let explicitly_listed: HashSet<_> = map .values() .flatten() - .filter_map(|fv| fv.explicitly_name()) + .filter_map(|fv| fv.explicit_dep_name()) .collect(); for dep in dependencies { if !dep.is_optional() { @@ -198,7 +198,7 @@ fn build_feature_map( FeatureName::new(feature)?; for fv in fvs { // Find data for the referenced dependency... - let dep_data = dep_map.get(&fv.dep_name()); + let dep_data = dep_map.get(&fv.feature_or_dep_name()); let is_any_dep = dep_data.is_some(); let is_optional_dep = dep_data.is_some_and(|&o| o); match fv { @@ -351,14 +351,15 @@ impl FeatureValue { } } - fn explicitly_name(&self) -> Option { + /// Returns the name of the dependency if and only if it was explicitly named with the `dep:` syntax. + fn explicit_dep_name(&self) -> Option { match self { FeatureValue::Dep { dep_name, .. } => Some(*dep_name), _ => None, } } - fn dep_name(&self) -> InternedString { + fn feature_or_dep_name(&self) -> InternedString { match self { FeatureValue::Feature(dep_name) | FeatureValue::Dep { dep_name, .. }