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