@@ -326,28 +326,30 @@ impl<'a, 'cfg> FeatureResolver<'a, 'cfg> {
326
326
// Activate the optional dep.
327
327
for ( dep_pkg_id, deps) in self . deps ( pkg_id, for_build) {
328
328
for ( dep, dep_for_build) in deps {
329
- if dep. name_in_toml ( ) == * dep_name {
330
- let fvs = self . fvs_from_dependency ( dep_pkg_id, dep) ;
331
- self . activate_pkg ( dep_pkg_id, & fvs, dep_for_build) ?;
329
+ if dep. name_in_toml ( ) != * dep_name {
330
+ continue ;
332
331
}
332
+ let fvs = self . fvs_from_dependency ( dep_pkg_id, dep) ;
333
+ self . activate_pkg ( dep_pkg_id, & fvs, dep_for_build) ?;
333
334
}
334
335
}
335
336
}
336
337
FeatureValue :: CrateFeature ( dep_name, dep_feature) => {
337
338
// Activate a feature within a dependency.
338
339
for ( dep_pkg_id, deps) in self . deps ( pkg_id, for_build) {
339
340
for ( dep, dep_for_build) in deps {
340
- if dep. name_in_toml ( ) == * dep_name {
341
- if dep. is_optional ( ) {
342
- // Activate the crate on self.
343
- let fv = FeatureValue :: Crate ( * dep_name) ;
344
- self . activate_fv ( pkg_id, & fv, for_build) ?;
345
- }
346
- // Activate the feature on the dependency.
347
- let summary = self . resolve . summary ( dep_pkg_id) ;
348
- let fv = FeatureValue :: new ( * dep_feature, summary) ;
349
- self . activate_fv ( dep_pkg_id, & fv, dep_for_build) ?;
341
+ if dep. name_in_toml ( ) != * dep_name {
342
+ continue ;
350
343
}
344
+ if dep. is_optional ( ) {
345
+ // Activate the crate on self.
346
+ let fv = FeatureValue :: Crate ( * dep_name) ;
347
+ self . activate_fv ( pkg_id, & fv, for_build) ?;
348
+ }
349
+ // Activate the feature on the dependency.
350
+ let summary = self . resolve . summary ( dep_pkg_id) ;
351
+ let fv = FeatureValue :: new ( * dep_feature, summary) ;
352
+ self . activate_fv ( dep_pkg_id, & fv, dep_for_build) ?;
351
353
}
352
354
}
353
355
}
0 commit comments