Avoid calling to_vec() unnecessarily in parser.

Also, rename the OptVec-to-vector conversion method to
opt_vec::take_vec() and convert from a method into a fn
because I fear strange bugs.
This commit is contained in:
Niko Matsakis 2013-03-01 19:38:39 -05:00
parent 50c08dbf0d
commit ca9549bdfc
5 changed files with 28 additions and 18 deletions

View file

@ -460,8 +460,8 @@ fn mk_impl(
let ty = cx.ty_path(
span,
~[ident],
generics.ty_params.map(
|tp| cx.ty_path(span, ~[tp.ident], ~[])).to_vec()
opt_vec::take_vec(generics.ty_params.map(
|tp| cx.ty_path(span, ~[tp.ident], ~[])))
);
let generics = ast::Generics {