drop the StdMap implementation from SmallIntMap

This commit is contained in:
Daniel Micay 2013-01-31 16:48:14 -05:00
parent 274e75cd82
commit 1057eea7ac

View File

@ -14,8 +14,6 @@
*/
#[forbid(deprecated_mode)];
use map::StdMap;
use core::container::{Container, Mutable, Map, Set};
use core::dvec::DVec;
use core::ops;
@ -98,8 +96,7 @@ impl<V> SmallIntMap<V>: Container {
}
/// Implements the map::map interface for smallintmap
impl<V: Copy> SmallIntMap<V>: StdMap<uint, V> {
pure fn size() -> uint { self.len() }
impl<V: Copy> SmallIntMap<V> {
#[inline(always)]
fn insert(key: uint, value: V) -> bool {
let exists = contains_key(self, key);
@ -172,11 +169,6 @@ impl<V: Copy> SmallIntMap<V>: ops::Index<uint, V> {
}
}
/// Cast the given smallintmap to a map::map
pub fn as_map<V: Copy>(s: SmallIntMap<V>) -> StdMap<uint, V> {
s as StdMap::<uint, V>
}
#[cfg(test)]
mod tests {
use smallintmap::{mk, SmallIntMap};