Skip to content

Commit 85f6d2d

Browse files
committed
tweek names to be clearer
1 parent 939a114 commit 85f6d2d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/cargo/core/summary.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ fn build_feature_map(
179179
let explicitly_listed: HashSet<_> = map
180180
.values()
181181
.flatten()
182-
.filter_map(|fv| fv.explicitly_name())
182+
.filter_map(|fv| fv.explicit_dep_name())
183183
.collect();
184184
for dep in dependencies {
185185
if !dep.is_optional() {
@@ -198,7 +198,7 @@ fn build_feature_map(
198198
FeatureName::new(feature)?;
199199
for fv in fvs {
200200
// Find data for the referenced dependency...
201-
let dep_data = dep_map.get(&fv.dep_name());
201+
let dep_data = dep_map.get(&fv.feature_or_dep_name());
202202
let is_any_dep = dep_data.is_some();
203203
let is_optional_dep = dep_data.is_some_and(|&o| o);
204204
match fv {
@@ -351,14 +351,15 @@ impl FeatureValue {
351351
}
352352
}
353353

354-
fn explicitly_name(&self) -> Option<InternedString> {
354+
/// Returns the name of the dependency if and only if it was explicitly named with the `dep:` syntax.
355+
fn explicit_dep_name(&self) -> Option<InternedString> {
355356
match self {
356357
FeatureValue::Dep { dep_name, .. } => Some(*dep_name),
357358
_ => None,
358359
}
359360
}
360361

361-
fn dep_name(&self) -> InternedString {
362+
fn feature_or_dep_name(&self) -> InternedString {
362363
match self {
363364
FeatureValue::Feature(dep_name)
364365
| FeatureValue::Dep { dep_name, .. }

0 commit comments

Comments
 (0)