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

login
register
mail settings
Submitter phabricator
Date Jan. 3, 2019, 10:54 p.m.
Message ID <8194217784d072d2df47838d2e14dfac@localhost.localdomain>
Download mbox | patch
Permalink /patch/37445/
State Not Applicable
Headers show

Comments

phabricator - Jan. 3, 2019, 10:54 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG35ee590b1892: rust: use &#039;impl Trait&#039; 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




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

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
@@ -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();