Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reserve capacity before extending Punctuated #1471

Closed
wants to merge 9 commits into from
Prev Previous commit
Next Next commit
Make use of the optimizations in the punctuated macro
  • Loading branch information
mo8it committed Jun 24, 2023
commit 7fa6b5f90472be7b2fe8ecb0396c90579c5cb9f1
6 changes: 1 addition & 5 deletions tests/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ macro_rules! errorf {

macro_rules! punctuated {
($($e:expr,)+) => {{
let mut seq = ::syn::punctuated::Punctuated::new();
$(
seq.push($e);
)+
seq
::syn::punctuated::Punctuated::from_iter([$($e),+])
}};

($($e:expr),+) => {
Expand Down