refactor(all): shorten redundant std::vec::Vec#23748
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
Pull request overview
Refactors several Rust modules across the workspace to shorten explicit std::vec::Vec type paths to the prelude Vec, now that arena vectors are consistently named ArenaVec (per prior refactor) and Vec is unambiguous.
Changes:
- Replaced
std::vec::Vec<T>withVec<T>in function signatures and local variable declarations. - Simplified a few
collect::<std::vec::Vec<_>>()/std::vec::Vec::lenuses tocollect::<Vec<_>>()/Vec::len. - Kept arena-allocated vectors using
ArenaVec, preserving the heap-vs-arena distinction.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_transformer/src/common/module_imports.rs | Uses Vec<Import<'a>> for heap-allocated name lists passed into import/require generation. |
| crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs | Simplifies a diagnostic helper local names collection to Vec<&str>. |
| crates/oxc_parser/src/module_record.rs | Shortens public-returned error list types to Vec<OxcDiagnostic> while keeping arena storage as ArenaVec. |
| crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs | Simplifies an iterator collect to Vec before join. |
| crates/oxc_minifier/src/keep_var.rs | Stores hoisted vars in Vec<...> without fully qualifying the path. |
| crates/oxc_linter/src/rules/react/jsx_curly_brace_presence.rs | Simplifies several collect::<...>() and a helper return type to Vec. |
| crates/oxc_formatter/src/formatter/jsdoc/wrap.rs | Shortens std::vec::Vec::len to Vec::len when computing column counts. |
| crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs | Uses Vec::new() for temporary number collection in math folding. |
| crates/oxc_ast/src/ast_impl/js.rs | Simplifies helper signatures/returns to Vec for collected identifiers and symbol ids. |
4b2595a to
2ea7dcc
Compare
44b3134 to
e3b8849
Compare
Merge activity
|
Pure refactor. #23748 made all usages of arena-allocated `Vec` be named `ArenaVec`. This makes plain `Vec` unambiguously refer to heap-allocated `Vec` from standard library. Shorten `std::vec::Vec` to just `Vec` in various places.
2ea7dcc to
d1f18cd
Compare
e3b8849 to
f65d8e5
Compare
Pure refactor. #23748 made all usages of arena-allocated `Vec` be named `ArenaVec`. This makes plain `Vec` unambiguously refer to heap-allocated `Vec` from standard library. Shorten `std::vec::Vec` to just `Vec` in various places.

Pure refactor.
#23748 made all usages of arena-allocated
Vecbe namedArenaVec. This makes plainVecunambiguously refer to heap-allocatedVecfrom standard library.Shorten
std::vec::Vecto justVecin various places.