mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Simlify with matches!()
This commit is contained in:
parent
513924a7e0
commit
e75e2ae5b6
20 changed files with 32 additions and 98 deletions
|
@ -73,10 +73,7 @@ pub(crate) mod fragments {
|
|||
// Parse a meta item , which excluded [], e.g : #[ MetaItem ]
|
||||
pub(crate) fn meta_item(p: &mut Parser) {
|
||||
fn is_delimiter(p: &mut Parser) -> bool {
|
||||
match p.current() {
|
||||
T!['{'] | T!['('] | T!['['] => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(p.current(), T!['{'] | T!['('] | T!['['])
|
||||
}
|
||||
|
||||
if is_delimiter(p) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue