Skip to content

Commit

Permalink
Touch up PR 328
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Dec 12, 2024
1 parent 238757d commit d03aba3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/identifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ impl Identifier {
unsafe { ptr_as_str(&self.head) }
}
}

pub(crate) fn ptr_eq(&self, rhs: &Self) -> bool {
self.head == rhs.head && self.tail == rhs.tail
}
}

impl Clone for Identifier {
Expand Down Expand Up @@ -257,12 +261,6 @@ impl Drop for Identifier {
}
}

impl Identifier {
pub(crate) fn ptr_eq(&self, rhs: &Self) -> bool {
self.head == rhs.head && self.tail == rhs.tail
}
}

impl PartialEq for Identifier {
fn eq(&self, rhs: &Self) -> bool {
if self.ptr_eq(rhs) {
Expand Down
2 changes: 2 additions & 0 deletions src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ impl Ord for Prerelease {
if self.identifier.ptr_eq(&rhs.identifier) {
return Ordering::Equal;
}

match self.is_empty() {
// A real release compares greater than prerelease.
true => return Ordering::Greater,
Expand Down Expand Up @@ -110,6 +111,7 @@ impl Ord for BuildMetadata {
if self.identifier.ptr_eq(&rhs.identifier) {
return Ordering::Equal;
}

let lhs = self.as_str().split('.');
let mut rhs = rhs.as_str().split('.');

Expand Down

0 comments on commit d03aba3

Please sign in to comment.