diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-21 12:25:32 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-21 12:25:32 +0000 |
commit | 782cb43c148ff400818af4daed96a6841916031c (patch) | |
tree | 945fd6597aa73ec1b887f0d60b5bc9d7ac59f2cb /crates/ra_syntax/src/algo.rs | |
parent | 2fa2805887e734647aabebc1f533ec76c48f538a (diff) | |
parent | 412ac63ff517c7eab5e1cfe0bf239616bd2c13a1 (diff) |
Merge #870
870: docs r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/algo.rs')
-rw-r--r-- | crates/ra_syntax/src/algo.rs | 1 |
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` | ||
36 | pub fn generate<T>(seed: Option<T>, step: impl Fn(&T) -> Option<T>) -> impl Iterator<Item = T> { | 37 | pub 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| { |