changeset 41105:35ee590b1892

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
author Yuya Nishihara <yuya@tcha.org>
date Tue, 18 Dec 2018 22:23:48 +0900
parents 247f51cfc668
children dc56a6273575
files rust/hg-core/src/ancestors.rs
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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<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();