De-export dlist, dvec. Part of #3583.

This commit is contained in:
Graydon Hoare 2012-10-01 17:25:21 -07:00
parent 5d8b694e14
commit 7ead3c0411
3 changed files with 6 additions and 12 deletions

View File

@ -201,22 +201,16 @@ mod util;
// Data structure modules
#[legacy_exports]
mod dvec;
#[path="iter-trait"]
mod dvec_iter {
#[legacy_exports];
#[path = "dvec.rs"]
#[legacy_exports]
mod inst;
}
#[legacy_exports]
mod dlist;
#[path="iter-trait"]
mod dlist_iter {
#[legacy_exports];
#[path ="dlist.rs"]
#[legacy_exports]
mod inst;
}
mod send_map;

View File

@ -1,5 +1,5 @@
#[allow(non_camel_case_types)]
type IMPL_T<A> = dlist::DList<A>;
pub type IMPL_T<A> = dlist::DList<A>;
/**
* Iterates through the current contents.
@ -8,7 +8,7 @@ type IMPL_T<A> = dlist::DList<A>;
* e.g. breadth-first search with in-place enqueues), but removing the current
* node is forbidden.
*/
pure fn EACH<A>(self: &IMPL_T<A>, f: fn(v: &A) -> bool) {
pub pure fn EACH<A>(self: &IMPL_T<A>, f: fn(v: &A) -> bool) {
let mut link = self.peek_n();
while option::is_some(&link) {
let nobe = option::get(&link);
@ -29,6 +29,6 @@ pure fn EACH<A>(self: &IMPL_T<A>, f: fn(v: &A) -> bool) {
}
}
pure fn SIZE_HINT<A>(self: &IMPL_T<A>) -> Option<uint> {
pub pure fn SIZE_HINT<A>(self: &IMPL_T<A>) -> Option<uint> {
Some(self.len())
}

View File

@ -1,12 +1,12 @@
#[allow(non_camel_case_types)]
type IMPL_T<A> = dvec::DVec<A>;
pub type IMPL_T<A> = dvec::DVec<A>;
/**
* Iterates through the current contents.
*
* Attempts to access this dvec during iteration will fail.
*/
pure fn EACH<A>(self: &IMPL_T<A>, f: fn(v: &A) -> bool) {
pub pure fn EACH<A>(self: &IMPL_T<A>, f: fn(v: &A) -> bool) {
unsafe {
do self.swap |v| {
v.each(f);
@ -15,6 +15,6 @@ pure fn EACH<A>(self: &IMPL_T<A>, f: fn(v: &A) -> bool) {
}
}
pure fn SIZE_HINT<A>(self: &IMPL_T<A>) -> Option<uint> {
pub pure fn SIZE_HINT<A>(self: &IMPL_T<A>) -> Option<uint> {
Some(self.len())
}