1
Fork 0

use vec![] macro to create Vector with first item inside instead of pushing to an empty vec![]

slightly reduces code bloat
This commit is contained in:
Matthias Krüger 2021-07-17 01:38:08 +02:00
parent 71a6c7c803
commit 1c129f7b97
4 changed files with 7 additions and 9 deletions

View file

@ -2189,8 +2189,7 @@ impl<'a> State<'a> {
Options(InlineAsmOptions),
}
let mut args = vec![];
args.push(AsmArg::Template(InlineAsmTemplatePiece::to_string(&asm.template)));
let mut args = vec![AsmArg::Template(InlineAsmTemplatePiece::to_string(&asm.template))];
args.extend(asm.operands.iter().map(|(o, _)| AsmArg::Operand(o)));
if !asm.options.is_empty() {
args.push(AsmArg::Options(asm.options));