From 412ac63ff517c7eab5e1cfe0bf239616bd2c13a1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 21 Feb 2019 15:24:42 +0300 Subject: docs --- crates/ra_syntax/src/algo.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'crates/ra_syntax/src/algo.rs') diff --git a/crates/ra_syntax/src/algo.rs b/crates/ra_syntax/src/algo.rs index 99b0983b0..e8cf0d4b5 100644 --- a/crates/ra_syntax/src/algo.rs +++ b/crates/ra_syntax/src/algo.rs @@ -33,6 +33,7 @@ pub fn find_covering_node(root: &SyntaxNode, range: TextRange) -> &SyntaxNode { SyntaxNode::from_repr(root.0.covering_node(range)) } +// Replace with `std::iter::successors` in `1.34.0` pub fn generate(seed: Option, step: impl Fn(&T) -> Option) -> impl Iterator { ::itertools::unfold(seed, move |slot| { slot.take().map(|curr| { -- cgit v1.2.3