Skip to content

Commit b236b42

Browse files
committed
remove code that is now redundunt
1 parent 47e3d16 commit b236b42

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

src/cargo/core/registry.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -556,13 +556,6 @@ fn lock(locked: &LockedMap, patches: &HashMap<Url, Vec<PackageId>>, summary: Sum
556556
// requirement has changed. In this case we must discard the
557557
// locked version because the dependency needs to be
558558
// re-resolved.
559-
//
560-
// 3. We don't have a lock entry for this dependency, in which
561-
// case it was likely an optional dependency which wasn't
562-
// included previously so we just pass it through anyway.
563-
//
564-
// Cases 1/2 are handled by `matches_id` and case 3 is handled by
565-
// falling through to the logic below.
566559
if let Some(&(_, ref locked_deps)) = pair {
567560
let locked = locked_deps.iter().find(|id| dep.matches_id(id));
568561
if let Some(locked) = locked {
@@ -573,20 +566,6 @@ fn lock(locked: &LockedMap, patches: &HashMap<Url, Vec<PackageId>>, summary: Sum
573566
}
574567
}
575568

576-
// If this dependency did not have a locked version, then we query
577-
// all known locked packages to see if they match this dependency.
578-
// If anything does then we lock it to that and move on.
579-
let v = locked
580-
.get(dep.source_id())
581-
.and_then(|map| map.get(&*dep.name()))
582-
.and_then(|vec| vec.iter().find(|&&(ref id, _)| dep.matches_id(id)));
583-
if let Some(&(ref id, _)) = v {
584-
trace!("\tsecond hit on {}", id);
585-
let mut dep = dep.clone();
586-
dep.lock_to(id);
587-
return dep;
588-
}
589-
590569
// Finally we check to see if any registered patches correspond to
591570
// this dependency.
592571
let v = patches.get(dep.source_id().url()).map(|vec| {

0 commit comments

Comments
 (0)