Skip to content

Commit

Permalink
Merge pull request #504 from dtolnay/smallvec
Browse files Browse the repository at this point in the history
OneVector type alias has been removed
  • Loading branch information
dtolnay committed Sep 28, 2018
2 parents d50d1a3 + 0eab7d9 commit 413684a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_precedence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ extern crate quote;
extern crate rayon;
extern crate regex;
extern crate rustc_data_structures;
#[macro_use]
extern crate smallvec;
extern crate syn;
extern crate syntax;
extern crate walkdir;
Expand Down Expand Up @@ -215,8 +217,8 @@ fn libsyntax_parse_and_rewrite(input: &str) -> Option<P<ast::Expr>> {
///
/// This method operates on libsyntax objects.
fn libsyntax_brackets(libsyntax_expr: P<ast::Expr>) -> Option<P<ast::Expr>> {
use rustc_data_structures::small_vec::OneVector;
use rustc_data_structures::thin_vec::ThinVec;
use smallvec::SmallVec;
use syntax::ast::{Expr, ExprKind, Field, Mac, Pat, Stmt, StmtKind, Ty};
use syntax::ext::quote::rt::DUMMY_SP;
use syntax::fold::{self, Folder};
Expand Down Expand Up @@ -261,15 +263,15 @@ fn libsyntax_brackets(libsyntax_expr: P<ast::Expr>) -> Option<P<ast::Expr>> {
ty
}

fn fold_stmt(&mut self, stmt: Stmt) -> OneVector<Stmt> {
fn fold_stmt(&mut self, stmt: Stmt) -> SmallVec<[Stmt; 1]> {
let node = match stmt.node {
// Don't wrap toplevel expressions in statements.
StmtKind::Expr(e) => StmtKind::Expr(e.map(|e| fold::noop_fold_expr(e, self))),
StmtKind::Semi(e) => StmtKind::Semi(e.map(|e| fold::noop_fold_expr(e, self))),
s => s,
};

OneVector::from_vec(vec![Stmt { node, ..stmt }])
smallvec![Stmt { node, ..stmt }]
}

fn fold_mac(&mut self, mac: Mac) -> Mac {
Expand Down

0 comments on commit 413684a

Please sign in to comment.