remove the redundant each method from OptVec
This commit is contained in:
parent
032dcc57e8
commit
5242e8d2ba
11 changed files with 19 additions and 26 deletions
|
|
@ -324,11 +324,11 @@ impl<'self> TraitDef<'self> {
|
|||
|
||||
let mut trait_generics = self.generics.to_generics(cx, span, type_ident, generics);
|
||||
// Copy the lifetimes
|
||||
for generics.lifetimes.each |l| {
|
||||
for generics.lifetimes.iter().advance |l| {
|
||||
trait_generics.lifetimes.push(copy *l)
|
||||
};
|
||||
// Create the type parameters.
|
||||
for generics.ty_params.each |ty_param| {
|
||||
for generics.ty_params.iter().advance |ty_param| {
|
||||
// I don't think this can be moved out of the loop, since
|
||||
// a TyParamBound requires an ast id
|
||||
let mut bounds = opt_vec::from(
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@ impl gen_init for protocol {
|
|||
fn buffer_ty_path(&self, cx: @ExtCtxt) -> @ast::Ty {
|
||||
let mut params: OptVec<ast::TyParam> = opt_vec::Empty;
|
||||
for (copy self.states).iter().advance |s| {
|
||||
for s.generics.ty_params.each |tp| {
|
||||
for s.generics.ty_params.iter().advance |tp| {
|
||||
match params.iter().find_(|tpp| tp.ident == tpp.ident) {
|
||||
None => params.push(*tp),
|
||||
_ => ()
|
||||
|
|
@ -392,7 +392,7 @@ impl gen_init for protocol {
|
|||
let ext_cx = cx;
|
||||
let mut params: OptVec<ast::TyParam> = opt_vec::Empty;
|
||||
let fields = do (copy self.states).iter().transform |s| {
|
||||
for s.generics.ty_params.each |tp| {
|
||||
for s.generics.ty_params.iter().advance |tp| {
|
||||
match params.iter().find_(|tpp| tp.ident == tpp.ident) {
|
||||
None => params.push(*tp),
|
||||
_ => ()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue