Skip to content

Commit

Permalink
Fix comment on Ord for SourceId (#15103)
Browse files Browse the repository at this point in the history
### What does this PR try to resolve?

In PR #14980, the Ord impl for SourceId was changed, but the comment
wasn’t updated. So it is now incorrect.

This PR updates the comment to match the implementation.

### How should we test and review this PR?

Read the Ord for SourceId code and make sure the updated comment
describes what it does.

### Additional information

None
  • Loading branch information
weihanglo authored Jan 25, 2025
2 parents cecde95 + 6e46d4c commit e63457a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cargo/core/source_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,8 @@ impl PartialOrd for SourceId {
}
}

// Custom comparison defined as canonical URL equality for git sources and URL
// equality for other sources, ignoring the `precise` and `name` fields.
// Custom comparison defined as source kind and canonical URL equality,
// ignoring the `precise` and `name` fields.
impl Ord for SourceId {
fn cmp(&self, other: &SourceId) -> Ordering {
// If our interior pointers are to the exact same `SourceIdInner` then
Expand Down

0 comments on commit e63457a

Please sign in to comment.