Remove OneVector

This commit is contained in:
ljedrz 2018-08-30 11:42:16 +02:00
parent beff387601
commit 130a32fa72
22 changed files with 134 additions and 177 deletions

View file

@ -17,9 +17,10 @@ extern crate syntax;
extern crate rustc;
extern crate rustc_data_structures;
extern crate rustc_plugin;
#[macro_use] extern crate smallvec;
extern crate syntax_pos;
use rustc_data_structures::small_vec::OneVector;
use smallvec::SmallVec;
use syntax::ext::base::{ExtCtxt, MacResult, MacEager};
use syntax::tokenstream;
use rustc_plugin::Registry;
@ -31,8 +32,8 @@ pub fn plugin_registrar(reg: &mut Registry) {
fn expand(cx: &mut ExtCtxt, _: syntax_pos::Span, _: &[tokenstream::TokenTree])
-> Box<MacResult+'static> {
MacEager::items(OneVector::from_vec(vec![
MacEager::items(smallvec![
quote_item!(cx, struct Struct1;).unwrap(),
quote_item!(cx, struct Struct2;).unwrap()
]))
])
}