mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
minor: improve readability
This commit is contained in:
parent
ed84717869
commit
c0556bd8c1
3 changed files with 17 additions and 15 deletions
|
@ -14,12 +14,20 @@ fn generic_param_list(p: &mut Parser) {
|
|||
p.bump(T![<]);
|
||||
|
||||
while !p.at(EOF) && !p.at(T![>]) {
|
||||
let m = p.start();
|
||||
generic_param(p);
|
||||
if !p.at(T![>]) && !p.expect(T![,]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
p.expect(T![>]);
|
||||
m.complete(p, GENERIC_PARAM_LIST);
|
||||
}
|
||||
|
||||
// test generic_param_list_param_attribute
|
||||
fn generic_param(p: &mut Parser) {
|
||||
let m = p.start();
|
||||
// test generic_param_attribute
|
||||
// fn foo<#[lt_attr] 'a, #[t_attr] T>() {}
|
||||
attributes::outer_attrs(p);
|
||||
|
||||
match p.current() {
|
||||
LIFETIME_IDENT => lifetime_param(p, m),
|
||||
IDENT => type_param(p, m),
|
||||
|
@ -29,12 +37,6 @@ fn generic_param_list(p: &mut Parser) {
|
|||
p.err_and_bump("expected type parameter")
|
||||
}
|
||||
}
|
||||
if !p.at(T![>]) && !p.expect(T![,]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
p.expect(T![>]);
|
||||
m.complete(p, GENERIC_PARAM_LIST);
|
||||
}
|
||||
|
||||
// test lifetime_param
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue