Skip to content

Commit 302374c

Browse files
committed
doc: add commment to summary_for_patch
1 parent 060e294 commit 302374c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/cargo/core/registry.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,12 @@ fn lock(
911911
})
912912
}
913913

914-
/// This is a helper for selecting the summary, or generating a helpful error message.
914+
/// A helper for selecting the summary, or generating a helpful error message.
915+
///
916+
/// Returns a tuple that the first element is the summary selected. The second
917+
/// is a package ID indicating that the patch entry should be unlocked. This
918+
/// happens when a match cannot be found with the `locked` one, but found one
919+
/// via the original patch, so we need to inform the resolver to "unlock" it.
915920
fn summary_for_patch(
916921
orig_patch: &Dependency,
917922
locked: &Option<LockedPatchDependency>,
@@ -961,9 +966,6 @@ fn summary_for_patch(
961966
let orig_matches = orig_matches.into_iter().map(|s| s.into_summary()).collect();
962967

963968
let summary = ready!(summary_for_patch(orig_patch, &None, orig_matches, source))?;
964-
965-
// The unlocked version found a match. This returns a value to
966-
// indicate that this entry should be unlocked.
967969
return Poll::Ready(Ok((summary.0, Some(locked.package_id))));
968970
}
969971
// Try checking if there are *any* packages that match this by name.

0 commit comments

Comments
 (0)