Skip to content

Commit

Permalink
Use Self in alloc
Browse files Browse the repository at this point in the history
  • Loading branch information
poliorcetics committed Sep 22, 2020
1 parent 87a5dec commit ec4e9cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/alloc/src/collections/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//! // Explicitly implement the trait so the queue becomes a min-heap
//! // instead of a max-heap.
//! impl Ord for State {
//! fn cmp(&self, other: &State) -> Ordering {
//! fn cmp(&self, other: &Self) -> Ordering {
//! // Notice that the we flip the ordering on costs.
//! // In case of a tie we compare positions - this step is necessary
//! // to make implementations of `PartialEq` and `Ord` consistent.
Expand All @@ -41,7 +41,7 @@
//!
//! // `PartialOrd` needs to be implemented as well.
//! impl PartialOrd for State {
//! fn partial_cmp(&self, other: &State) -> Option<Ordering> {
//! fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
//! Some(self.cmp(other))
//! }
//! }
Expand Down

0 comments on commit ec4e9cd

Please sign in to comment.