mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-15 14:43:58 +00:00
Merge #1794
1794: tiny simplification r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
76f39b4b20
4 changed files with 8 additions and 5 deletions
|
@ -125,7 +125,7 @@ pub(crate) mod fragments {
|
|||
let m = p.start();
|
||||
|
||||
while !p.at(EOF) {
|
||||
if p.current() == T![;] {
|
||||
if p.at(T![;]) {
|
||||
p.bump();
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use super::*;
|
||||
|
||||
pub(super) fn inner_attributes(p: &mut Parser) {
|
||||
while p.current() == T![#] && p.nth(1) == T![!] {
|
||||
while p.at(T![#]) && p.nth(1) == T![!] {
|
||||
attribute(p, true)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ pub(crate) fn expr_block_contents(p: &mut Parser) {
|
|||
// struct S {};
|
||||
// }
|
||||
|
||||
if p.current() == T![;] {
|
||||
if p.at(T![;]) {
|
||||
p.bump();
|
||||
continue;
|
||||
}
|
||||
|
@ -302,7 +302,7 @@ fn expr_bp(
|
|||
newly_dollar_open = false;
|
||||
}
|
||||
|
||||
let is_range = p.current() == T![..] || p.current() == T![..=];
|
||||
let is_range = p.at(T![..]) || p.at(T![..=]);
|
||||
let (op_bp, op) = current_op(p);
|
||||
if op_bp < bp {
|
||||
break;
|
||||
|
|
|
@ -156,7 +156,10 @@ fn is_where_predicate(p: &mut Parser) -> bool {
|
|||
}
|
||||
|
||||
fn is_where_clause_end(p: &mut Parser) -> bool {
|
||||
p.current() == T!['{'] || p.current() == T![;] || p.current() == T![=]
|
||||
match p.current() {
|
||||
T!['{'] | T![;] | T![=] => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
fn where_predicate(p: &mut Parser) {
|
||||
|
|
Loading…
Reference in a new issue