diff options
Diffstat (limited to 'crates/libsyntax2/src/algo')
-rw-r--r-- | crates/libsyntax2/src/algo/mod.rs | 2 |
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 | ||
122 | fn generate<T>(seed: Option<T>, step: impl Fn(&T) -> Option<T>) -> impl Iterator<Item=T> { | 122 | pub 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); |