1
Fork 0

Rollup merge of #77079 - poliorcetics:more-self-in-docs, r=jyn514

Use `Self` in docs when possible

Fixes #76542.

I used `rg '\s*//[!/]\s+fn [\w_]+\(&?self, ' .` in `library/` to find instances, I found some with that and some by manually checking.

@rustbot modify labels: C-enhancement T-doc
This commit is contained in:
Jonas Schievink 2020-09-25 02:29:42 +02:00 committed by GitHub
commit dc4f39c43f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 60 additions and 57 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))
//! }
//! }