mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
refactor the if if
This commit is contained in:
parent
d3858f7465
commit
73fde17017
@ -365,10 +365,14 @@ fn parse_options<'a>(
|
||||
|
||||
'blk: {
|
||||
for (symbol, option) in OPTIONS {
|
||||
let expect =
|
||||
!is_global_asm || ast::InlineAsmOptions::GLOBAL_OPTIONS.contains(option);
|
||||
let kw_matched =
|
||||
if !is_global_asm || ast::InlineAsmOptions::GLOBAL_OPTIONS.contains(option) {
|
||||
p.eat_keyword(symbol)
|
||||
} else {
|
||||
p.eat_keyword_noexpect(symbol)
|
||||
};
|
||||
|
||||
if if expect { p.eat_keyword(symbol) } else { p.eat_keyword_noexpect(symbol) } {
|
||||
if kw_matched {
|
||||
try_set_option(p, args, is_global_asm, symbol, option);
|
||||
break 'blk;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user