Skip to content

Commit e357d17

Browse files
committed
Simplify retrieval of dependency data
1 parent c24a097 commit e357d17

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/cargo/core/summary.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,12 @@ fn build_feature_map(
145145

146146
// Find data for the referenced dependency...
147147
let dep_data = {
148-
let dep_name = match val {
149-
Feature(_) => "",
150-
Crate(ref dep_name) | CrateFeature(ref dep_name, _) => dep_name,
151-
};
152-
dependencies.iter().find(|d| *d.name() == *dep_name)
148+
match val {
149+
Feature(_) => None,
150+
Crate(ref dep_name) | CrateFeature(ref dep_name, _) => {
151+
dependencies.iter().find(|d| d.name() == *dep_name)
152+
}
153+
}
153154
};
154155

155156
match (&val, dep_data) {

0 commit comments

Comments
 (0)