]> git.proxmox.com Git - cargo.git/commitdiff
Minor cleanup.
authorEric Huss <eric@huss.org>
Fri, 23 Oct 2020 23:12:10 +0000 (16:12 -0700)
committerEric Huss <eric@huss.org>
Fri, 23 Oct 2020 23:12:10 +0000 (16:12 -0700)
src/cargo/core/resolver/features.rs
src/cargo/core/summary.rs

index 113d18461cd6e188f7d0bc6d805021cdae8b66f3..8db68ceaedd1023675b6c84c53b49f94d891c9ba 100644 (file)
@@ -475,7 +475,6 @@ impl<'a, 'cfg> FeatureResolver<'a, 'cfg> {
                             // Activate the crate on self.
                             let fv = FeatureValue::Crate {
                                 dep_name: *dep_name,
-                                // explicit: *explicit,
                             };
                             self.activate_fv(pkg_id, &fv, for_host)?;
                             if !explicit {
index 0ca8e2cbc64817921475528dcc1ce61d0e176a6b..a18fa4be4ba842acf5d5b4e2293467052aed7e17 100644 (file)
@@ -350,8 +350,8 @@ impl FeatureValue {
             Some(pos) => {
                 let (dep, dep_feat) = feature.split_at(pos);
                 let dep_feat = &dep_feat[1..];
-                let (dep, explicit) = if dep.starts_with("crate:") {
-                    (&dep[6..], true)
+                let (dep, explicit) = if let Some(dep) = dep.strip_prefix("crate:") {
+                    (dep, true)
                 } else {
                     (dep, false)
                 };