Use ThinVec
in a few more AST types.
This commit is contained in:
parent
549f1c60af
commit
7e855d5f31
11 changed files with 72 additions and 69 deletions
|
@ -2935,8 +2935,8 @@ impl<'a> Parser<'a> {
|
|||
pth: ast::Path,
|
||||
recover: bool,
|
||||
close_delim: Delimiter,
|
||||
) -> PResult<'a, (Vec<ExprField>, ast::StructRest, bool)> {
|
||||
let mut fields = Vec::new();
|
||||
) -> PResult<'a, (ThinVec<ExprField>, ast::StructRest, bool)> {
|
||||
let mut fields = ThinVec::new();
|
||||
let mut base = ast::StructRest::None;
|
||||
let mut recover_async = false;
|
||||
|
||||
|
|
|
@ -56,12 +56,12 @@ impl<'a> Parser<'a> {
|
|||
pub fn parse_mod(
|
||||
&mut self,
|
||||
term: &TokenKind,
|
||||
) -> PResult<'a, (AttrVec, Vec<P<Item>>, ModSpans)> {
|
||||
) -> PResult<'a, (AttrVec, ThinVec<P<Item>>, ModSpans)> {
|
||||
let lo = self.token.span;
|
||||
let attrs = self.parse_inner_attributes()?;
|
||||
|
||||
let post_attr_lo = self.token.span;
|
||||
let mut items = vec![];
|
||||
let mut items = ThinVec::new();
|
||||
while let Some(item) = self.parse_item(ForceCollect::No)? {
|
||||
items.push(item);
|
||||
self.maybe_consume_incorrect_semicolon(&items);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue