mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
clippy: type_complexity
This commit is contained in:
parent
bc774fe6cf
commit
fc8024de51
2 changed files with 11 additions and 8 deletions
|
@ -98,17 +98,18 @@ fn is_contextual_kw(text: &str) -> bool {
|
|||
}
|
||||
}
|
||||
|
||||
fn find_reparsable_node<'node>(
|
||||
node: SyntaxNodeRef<'node>,
|
||||
type ParseFn = fn(&mut Parser);
|
||||
fn find_reparsable_node(
|
||||
node: SyntaxNodeRef<'_>,
|
||||
range: TextRange,
|
||||
) -> Option<(SyntaxNodeRef<'node>, fn(&mut Parser))> {
|
||||
) -> Option<(SyntaxNodeRef<'_>, ParseFn)> {
|
||||
let node = algo::find_covering_node(node, range);
|
||||
return node
|
||||
.ancestors()
|
||||
.filter_map(|node| reparser(node).map(|r| (node, r)))
|
||||
.next();
|
||||
|
||||
fn reparser(node: SyntaxNodeRef) -> Option<fn(&mut Parser)> {
|
||||
fn reparser(node: SyntaxNodeRef) -> Option<ParseFn> {
|
||||
let res = match node.kind() {
|
||||
BLOCK => grammar::block,
|
||||
NAMED_FIELD_DEF_LIST => grammar::named_field_def_list,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue