Use Self in alloc

This commit is contained in:
Alexis Bourget 2020-09-23 00:31:37 +02:00
parent 87a5dec4db
commit ec4e9cd12a
1 changed files with 2 additions and 2 deletions

View File

@ -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.
@ -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))
//! }
//! }