rust/src/libcore/iter-trait/dvec.rs

17 lines
368 B
Rust
Raw Normal View History

2012-05-09 19:30:31 -05:00
type IMPL_T<A> = dvec::dvec<A>;
#[doc = "
Iterates through the current contents.
Attempts to access this dvec during iteration will fail.
"]
fn EACH<A>(self: IMPL_T<A>, f: fn(A) -> bool) {
import dvec::extensions;
2012-06-30 18:19:07 -05:00
self.swap(|v| { vec::each(v, f); v })
2012-05-09 19:30:31 -05:00
}
fn SIZE_HINT<A>(self: IMPL_T<A>) -> option<uint> {
import dvec::extensions;
some(self.len())
}