Skip to content

Commit

Permalink
doc: add commment to summary_for_patch
Browse files Browse the repository at this point in the history
  • Loading branch information
weihanglo committed Apr 10, 2024
1 parent f978671 commit 80d0d94
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/cargo/core/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,12 @@ fn lock(
})
}

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

let summary = ready!(summary_for_patch(orig_patch, &None, orig_matches, source))?;

// The unlocked version found a match. This returns a value to
// indicate that this entry should be unlocked.
return Poll::Ready(Ok((summary.0, Some(locked.package_id))));
}
// Try checking if there are *any* packages that match this by name.
Expand Down

0 comments on commit 80d0d94

Please sign in to comment.