# HG changeset patch # User Yuya Nishihara # Date 1545139428 -32400 # Node ID 35ee590b18922636a5437ef29ab6fc291ae04e34 # Parent 247f51cfc66820eaf48a495729c52a4e21a527ca rust: use 'impl Trait' in method argument of AncestorsIterator I just didn't know it's stabilized. Let's switch to new convenient syntax. Differential Revision: https://phab.mercurial-scm.org/D5451 diff -r 247f51cfc668 -r 35ee590b1892 rust/hg-core/src/ancestors.rs --- a/rust/hg-core/src/ancestors.rs Tue Dec 18 22:12:16 2018 +0900 +++ b/rust/hg-core/src/ancestors.rs Tue Dec 18 22:23:48 2018 +0900 @@ -44,15 +44,12 @@ /// /// if `inclusive` is true, then the init revisions are emitted in /// particular, otherwise iteration starts from their parents. - pub fn new( + pub fn new( graph: G, - initrevs: I, + initrevs: impl IntoIterator, stoprev: Revision, inclusive: bool, - ) -> Result - where - I: IntoIterator, - { + ) -> Result { let filtered_initrevs = initrevs.into_iter().filter(|&r| r >= stoprev); if inclusive { let visit: BinaryHeap = filtered_initrevs.collect();