1
Fork 0

Rollup merge of #130235 - compiler-errors:nested-if, r=michaelwoerister

Simplify some nested `if` statements

Applies some but not all instances of `clippy::collapsible_if`. Some ended up looking worse afterwards, though, so I left those out. Also applies instances of `clippy::collapsible_else_if`

Review with whitespace disabled please.
This commit is contained in:
Stuart Cook 2024-09-12 20:37:16 +10:00 committed by GitHub
commit 3ba12756d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
61 changed files with 563 additions and 671 deletions

View file

@ -235,13 +235,11 @@ pub fn parse_asm_args<'a>(
continue;
}
args.named_args.insert(name, slot);
} else {
if !args.named_args.is_empty() || !args.reg_args.is_empty() {
let named = args.named_args.values().map(|p| args.operands[*p].1).collect();
let explicit = args.reg_args.iter().map(|p| args.operands[p].1).collect();
} else if !args.named_args.is_empty() || !args.reg_args.is_empty() {
let named = args.named_args.values().map(|p| args.operands[*p].1).collect();
let explicit = args.reg_args.iter().map(|p| args.operands[p].1).collect();
dcx.emit_err(errors::AsmPositionalAfter { span, named, explicit });
}
dcx.emit_err(errors::AsmPositionalAfter { span, named, explicit });
}
}