diff --git a/src/hash/bench.rs b/src/bench.rs similarity index 100% rename from src/hash/bench.rs rename to src/bench.rs diff --git a/src/hash/mod.rs b/src/hash/mod.rs deleted file mode 100644 index 7a22bec5a3f..00000000000 --- a/src/hash/mod.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -//! Unordered containers, implemented as hash-tables - -mod bench; -mod table; -pub mod map; -pub mod set; - -trait Recover { - type Key; - - fn get(&self, key: &Q) -> Option<&Self::Key>; - fn take(&mut self, key: &Q) -> Option; - fn replace(&mut self, key: Self::Key) -> Option; -} diff --git a/src/lib.rs b/src/lib.rs index 3cca486000d..f8dc84cde83 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,15 +6,19 @@ extern crate alloc; pub use std::*; -#[path="hash/mod.rs"] -mod impls; +mod bench; +mod table; +#[path="map.rs"] +pub mod hash_map; +#[path="set.rs"] +pub mod hash_set; -pub mod hash_map { - pub use super::impls::map::*; -} +trait Recover { + type Key; -pub mod hash_set { - pub use super::impls::set::*; + fn get(&self, key: &Q) -> Option<&Self::Key>; + fn take(&mut self, key: &Q) -> Option; + fn replace(&mut self, key: Self::Key) -> Option; } mod shim { diff --git a/src/hash/map.rs b/src/map.rs similarity index 100% rename from src/hash/map.rs rename to src/map.rs diff --git a/src/hash/set.rs b/src/set.rs similarity index 99% rename from src/hash/set.rs rename to src/set.rs index d27deaa190c..a1a45812024 100644 --- a/src/hash/set.rs +++ b/src/set.rs @@ -15,7 +15,7 @@ use iter::{Chain, FromIterator}; use ops::{BitOr, BitAnd, BitXor, Sub}; use super::Recover; -use super::map::{self, HashMap, Keys, RandomState}; +use super::hash_map::{self, HashMap, Keys, RandomState}; // Future Optimization (FIXME!) // ============================= @@ -882,7 +882,7 @@ pub struct Iter<'a, K: 'a> { /// [`HashSet`]: struct.HashSet.html /// [`into_iter`]: struct.HashSet.html#method.into_iter pub struct IntoIter { - iter: map::IntoIter, + iter: hash_map::IntoIter, } /// A draining iterator over the items of a `HashSet`. @@ -893,7 +893,7 @@ pub struct IntoIter { /// [`HashSet`]: struct.HashSet.html /// [`drain`]: struct.HashSet.html#method.drain pub struct Drain<'a, K: 'static> { - iter: map::Drain<'a, K, ()>, + iter: hash_map::Drain<'a, K, ()>, } /// A lazy iterator producing elements in the intersection of `HashSet`s. diff --git a/src/hash/table.rs b/src/table.rs similarity index 100% rename from src/hash/table.rs rename to src/table.rs