mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-31 15:47:31 +00:00
docs
This commit is contained in:
parent
2fa2805887
commit
412ac63ff5
11 changed files with 143 additions and 98 deletions
|
@ -33,6 +33,7 @@ pub fn find_covering_node(root: &SyntaxNode, range: TextRange) -> &SyntaxNode {
|
|||
SyntaxNode::from_repr(root.0.covering_node(range))
|
||||
}
|
||||
|
||||
// Replace with `std::iter::successors` in `1.34.0`
|
||||
pub fn generate<T>(seed: Option<T>, step: impl Fn(&T) -> Option<T>) -> impl Iterator<Item = T> {
|
||||
::itertools::unfold(seed, move |slot| {
|
||||
slot.take().map(|curr| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue