aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/algo.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-02-21 12:24:42 +0000
committerAleksey Kladov <[email protected]>2019-02-21 12:24:42 +0000
commit412ac63ff517c7eab5e1cfe0bf239616bd2c13a1 (patch)
tree945fd6597aa73ec1b887f0d60b5bc9d7ac59f2cb /crates/ra_syntax/src/algo.rs
parent2fa2805887e734647aabebc1f533ec76c48f538a (diff)
docs
Diffstat (limited to 'crates/ra_syntax/src/algo.rs')
-rw-r--r--crates/ra_syntax/src/algo.rs1
1 files changed, 1 insertions, 0 deletions
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 {
33 SyntaxNode::from_repr(root.0.covering_node(range)) 33 SyntaxNode::from_repr(root.0.covering_node(range))
34} 34}
35 35
36// Replace with `std::iter::successors` in `1.34.0`
36pub fn generate<T>(seed: Option<T>, step: impl Fn(&T) -> Option<T>) -> impl Iterator<Item = T> { 37pub fn generate<T>(seed: Option<T>, step: impl Fn(&T) -> Option<T>) -> impl Iterator<Item = T> {
37 ::itertools::unfold(seed, move |slot| { 38 ::itertools::unfold(seed, move |slot| {
38 slot.take().map(|curr| { 39 slot.take().map(|curr| {