Reserve space in advance
This commit is contained in:
parent
2ca0b85593
commit
a7f2bb6343
4 changed files with 9 additions and 7 deletions
|
@ -66,7 +66,7 @@ fn show_substructure(cx: &mut ExtCtxt<'_>, span: Span, substr: &Substructure<'_>
|
|||
|
||||
let fmt = substr.nonself_args[0].clone();
|
||||
|
||||
let mut stmts = vec![];
|
||||
let mut stmts = Vec::with_capacity(fields.len() + 2);
|
||||
match vdata {
|
||||
ast::VariantData::Tuple(..) | ast::VariantData::Unit(..) => {
|
||||
// tuple struct/"normal" variant
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue