From 8b0298ce095b6dd635f7ed35dc97f1874157040b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 27 Aug 2018 10:01:31 +0300 Subject: scopes --- crates/libsyntax2/src/algo/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/libsyntax2/src/algo/mod.rs') 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 panic!("Can't find common ancestor of {:?} and {:?}", n1, n2) } -fn generate(seed: Option, step: impl Fn(&T) -> Option) -> impl Iterator { +pub fn generate(seed: Option, step: impl Fn(&T) -> Option) -> impl Iterator { ::itertools::unfold(seed, move |slot| { slot.take().map(|curr| { *slot = step(&curr); -- cgit v1.2.3