Patchwork rust: remove comment about error handling of AncestorsIterator

login
register
mail settings
Submitter Yuya Nishihara
Date Dec. 11, 2018, 1:25 p.m.
Message ID <76d8b20139a3b8b5835c.1544534742@mimosa>
Download mbox | patch
Permalink /patch/37109/
State Accepted
Headers show

Comments

Yuya Nishihara - Dec. 11, 2018, 1:25 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1544534619 -32400
#      Tue Dec 11 22:23:39 2018 +0900
# Node ID 76d8b20139a3b8b5835c7262216b97275845b582
# Parent  4e17679c336bc38709c32d9b8972f0e402e0057a
rust: remove comment about error handling of AncestorsIterator

To be align with 443eb4bc41af "rust: propagate error of index_get_parents()
properly."

Spotted by Georges Racinet.
Pulkit Goyal - Dec. 11, 2018, 1:49 p.m.
On Tue, Dec 11, 2018 at 4:27 PM Yuya Nishihara <yuya@tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1544534619 -32400
> #      Tue Dec 11 22:23:39 2018 +0900
> # Node ID 76d8b20139a3b8b5835c7262216b97275845b582
> # Parent  4e17679c336bc38709c32d9b8972f0e402e0057a
> rust: remove comment about error handling of AncestorsIterator
>
> To be align with 443eb4bc41af "rust: propagate error of index_get_parents()
> properly."
>
> Spotted by Georges Racinet.
>
Queued, many thanks!

Patch

diff --git a/rust/hg-core/src/ancestors.rs b/rust/hg-core/src/ancestors.rs
--- a/rust/hg-core/src/ancestors.rs
+++ b/rust/hg-core/src/ancestors.rs
@@ -105,18 +105,6 @@  impl<G: Graph> AncestorsIterator<G> {
 ///   (case where p1 == rev-1), because it amounts to update the first element
 ///   of the heap without sifting, which Rust's BinaryHeap doesn't let us do.
 /// - we save a few pushes by comparing with `stoprev` before pushing
-///
-/// Error treatment:
-/// We swallow the possible GraphError of conditionally_push_parents() to
-/// respect the Iterator trait in a simple manner: never emitting parents
-/// for the returned revision. We finds this good enough for now, because:
-///
-/// - there's a good chance that invalid revisionss are fed from the start,
-///   and `new()` doesn't swallow the error result.
-/// - this is probably what the Python implementation produces anyway, due
-///   to filtering at each step, and Python code is currently the only
-///   concrete caller we target, so we shouldn't need a finer error treatment
-///   for the time being.
 impl<G: Graph> Iterator for AncestorsIterator<G> {
     type Item = Result<Revision, GraphError>;