Mercurial > hg
comparison rust/hg-core/src/ancestors.rs @ 40932:dc38d976ff4d
rust: improved docstring
In the previous wording, rustfmt wanted to cut at the == which is not very
readable in my taste.
Differential Revision: https://phab.mercurial-scm.org/D5414
author | Georges Racinet <gracinet@anybox.fr> |
---|---|
date | Tue, 11 Dec 2018 17:31:54 +0100 |
parents | 43ca24b772d6 |
children | 18513d6ef7d4 |
comparison
equal
deleted
inserted
replaced
40931:e54bfde922f2 | 40932:dc38d976ff4d |
---|---|
99 /// The algorithm is the same as in `_lazyancestorsiter()` from `ancestors.py` | 99 /// The algorithm is the same as in `_lazyancestorsiter()` from `ancestors.py` |
100 /// with a few non crucial differences: | 100 /// with a few non crucial differences: |
101 /// | 101 /// |
102 /// - there's no filtering of invalid parent revisions. Actually, it should be | 102 /// - there's no filtering of invalid parent revisions. Actually, it should be |
103 /// consistent and more efficient to filter them from the end caller. | 103 /// consistent and more efficient to filter them from the end caller. |
104 /// - we don't have the optimization for adjacent revs | 104 /// - we don't have the optimization for adjacent revisions (i.e., the case |
105 /// (case where p1 == rev-1), because it amounts to update the first element | 105 /// where `p1 == rev - 1`), because it amounts to update the first element of |
106 /// of the heap without sifting, which Rust's BinaryHeap doesn't let us do. | 106 /// the heap without sifting, which Rust's BinaryHeap doesn't let us do. |
107 /// - we save a few pushes by comparing with `stoprev` before pushing | 107 /// - we save a few pushes by comparing with `stoprev` before pushing |
108 impl<G: Graph> Iterator for AncestorsIterator<G> { | 108 impl<G: Graph> Iterator for AncestorsIterator<G> { |
109 type Item = Result<Revision, GraphError>; | 109 type Item = Result<Revision, GraphError>; |
110 | 110 |
111 fn next(&mut self) -> Option<Self::Item> { | 111 fn next(&mut self) -> Option<Self::Item> { |