D5451: rust: use 'impl Trait' in method argument of AncestorsIterator

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Thu Jan 3 22:54:05 UTC 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG35ee590b1892: rust: use 'impl Trait' in method argument of AncestorsIterator (authored by yuja, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5451?vs=12897&id=13002

REVISION DETAIL
  https://phab.mercurial-scm.org/D5451

AFFECTED FILES
  rust/hg-core/src/ancestors.rs

CHANGE DETAILS

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
@@ -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<I>(
+    pub fn new(
         graph: G,
-        initrevs: I,
+        initrevs: impl IntoIterator<Item = Revision>,
         stoprev: Revision,
         inclusive: bool,
-    ) -> Result<Self, GraphError>
-    where
-        I: IntoIterator<Item = Revision>,
-    {
+    ) -> Result<Self, GraphError> {
         let filtered_initrevs = initrevs.into_iter().filter(|&r| r >= stoprev);
         if inclusive {
             let visit: BinaryHeap<Revision> = filtered_initrevs.collect();



To: yuja, #hg-reviewers
Cc: durin42, kevincox, mercurial-devel


More information about the Mercurial-devel mailing list