Skip to content

Commit

Permalink
fix: implement PartialOrd correctly for types implementing Ord (#295)
Browse files Browse the repository at this point in the history
* chore: update Cargo.lock

* fix: implement PartialOrd in a way that makes clippy happy
  • Loading branch information
Shadow53 authored Oct 11, 2023
1 parent 87c224d commit 0823bf7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion quil-rs/src/instruction/control_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl std::hash::Hash for TargetPlaceholder {

impl PartialOrd for TargetPlaceholder {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.address().partial_cmp(&other.address())
Some(self.cmp(other))
}
}

Expand Down
2 changes: 1 addition & 1 deletion quil-rs/src/instruction/qubit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl PartialEq for QubitPlaceholder {

impl PartialOrd for QubitPlaceholder {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.address().partial_cmp(&other.address())
Some(self.cmp(other))
}
}

Expand Down

0 comments on commit 0823bf7

Please sign in to comment.