From e357d174841c9e373ce3367918dda4feccee3fcb Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 5 Apr 2018 15:22:37 +0200 Subject: [PATCH] Simplify retrieval of dependency data --- src/cargo/core/summary.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/cargo/core/summary.rs b/src/cargo/core/summary.rs index 1392aa36f..a824233f9 100644 --- a/src/cargo/core/summary.rs +++ b/src/cargo/core/summary.rs @@ -145,11 +145,12 @@ fn build_feature_map( // Find data for the referenced dependency... let dep_data = { - let dep_name = match val { - Feature(_) => "", - Crate(ref dep_name) | CrateFeature(ref dep_name, _) => dep_name, - }; - dependencies.iter().find(|d| *d.name() == *dep_name) + match val { + Feature(_) => None, + Crate(ref dep_name) | CrateFeature(ref dep_name, _) => { + dependencies.iter().find(|d| d.name() == *dep_name) + } + } }; match (&val, dep_data) { -- 2.30.2