Skip to content

Commit

Permalink
resolve warning
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp committed Nov 27, 2023
1 parent 160ff80 commit aeefd6b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions rust/tournament/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,8 @@ impl Ord for Team {
}

impl PartialOrd for Team {
fn partial_cmp(&self, other: &Team) -> Option<std::cmp::Ordering> {
// Sort by points descending then alphabetically
if other.points() != self.points() {
Some(other.points().cmp(&self.points()))
} else {
Some(self.name.cmp(&other.name))
}
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
}
}

Expand Down

0 comments on commit aeefd6b

Please sign in to comment.