From 0c8731e65ce535254114c6404d46b2074d96ab07 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Mon, 24 Feb 2014 22:18:19 -0400 Subject: [PATCH] Replaced list::each with iter() in Arenas's Drop impl --- src/libarena/lib.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs index 717e5ec7b18b8..1fc88eda37b5f 100644 --- a/src/libarena/lib.rs +++ b/src/libarena/lib.rs @@ -25,7 +25,6 @@ extern crate collections; use collections::list::{List, Cons, Nil}; -use collections::list; use std::cast::{transmute, transmute_mut, transmute_mut_region}; use std::cast; @@ -44,7 +43,7 @@ use std::vec; // The way arena uses arrays is really deeply awful. The arrays are // allocated, and have capacities reserved, but the fill for the array // will always stay at 0. -#[deriving(Clone)] +#[deriving(Clone, Eq)] struct Chunk { data: Rc>, fill: Cell, @@ -119,13 +118,11 @@ impl Drop for Arena { fn drop(&mut self) { unsafe { destroy_chunk(&self.head); - - list::each(self.chunks.get(), |chunk| { + for chunk in self.chunks.get().iter() { if !chunk.is_pod.get() { destroy_chunk(chunk); } - true - }); + } } } }