aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/algo
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-27 08:01:31 +0100
committerAleksey Kladov <[email protected]>2018-08-27 08:01:31 +0100
commit8b0298ce095b6dd635f7ed35dc97f1874157040b (patch)
tree3d6f941f7612ba1800c1e2f9fbb0a94761999be7 /crates/libsyntax2/src/algo
parent9b69c7df194d5f9081698745ed20414d7c7c2f1c (diff)
scopes
Diffstat (limited to 'crates/libsyntax2/src/algo')
-rw-r--r--crates/libsyntax2/src/algo/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/libsyntax2/src/algo/mod.rs b/crates/libsyntax2/src/algo/mod.rs
index 2640d60ea..7287f5bb2 100644
--- a/crates/libsyntax2/src/algo/mod.rs
+++ b/crates/libsyntax2/src/algo/mod.rs
@@ -119,7 +119,7 @@ fn common_ancestor<'a>(n1: SyntaxNodeRef<'a>, n2: SyntaxNodeRef<'a>) -> SyntaxNo
119 panic!("Can't find common ancestor of {:?} and {:?}", n1, n2) 119 panic!("Can't find common ancestor of {:?} and {:?}", n1, n2)
120} 120}
121 121
122fn generate<T>(seed: Option<T>, step: impl Fn(&T) -> Option<T>) -> impl Iterator<Item=T> { 122pub fn generate<T>(seed: Option<T>, step: impl Fn(&T) -> Option<T>) -> impl Iterator<Item=T> {
123 ::itertools::unfold(seed, move |slot| { 123 ::itertools::unfold(seed, move |slot| {
124 slot.take().map(|curr| { 124 slot.take().map(|curr| {
125 *slot = step(&curr); 125 *slot = step(&curr);