diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2013-02-02 16:19:47 -0500 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2013-02-03 15:55:11 -0500 |
| commit | 119c78073b6a0ab62b90d05d12eac58af2a5cfb4 (patch) | |
| tree | 6289ba9d8cc165804cdb986f510b24744a7ee074 /src/libstd | |
| parent | 81b4f36d49c8e9632e894f7443c9629f3c2ea294 (diff) | |
| download | rust-119c78073b6a0ab62b90d05d12eac58af2a5cfb4.tar.gz rust-119c78073b6a0ab62b90d05d12eac58af2a5cfb4.zip | |
oldmap: start conversion to explicit self
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/oldmap.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/libstd/oldmap.rs b/src/libstd/oldmap.rs index 5ab0bd68299..adfc8854443 100644 --- a/src/libstd/oldmap.rs +++ b/src/libstd/oldmap.rs @@ -18,7 +18,6 @@ use core::io::WriterUtil; use core::io; use core::ops; use core::to_str::ToStr; -use core::mutable::Mut; use core::prelude::*; use core::to_bytes::IterBytes; use core::uint; @@ -175,7 +174,7 @@ pub mod chained { } impl<K:Eq IterBytes Hash Copy, V: Copy> T<K, V> { - pure fn contains_key_ref(k: &K) -> bool { + pure fn contains_key_ref(&self, k: &K) -> bool { let hash = k.hash_keyed(0,0) as uint; match self.search_tbl(k, hash) { NotFound => false, @@ -227,7 +226,7 @@ pub mod chained { } } - pure fn find(k: K) -> Option<V> { + pure fn find(&self, k: K) -> Option<V> { unsafe { match self.search_tbl(&k, k.hash_keyed(0,0) as uint) { NotFound => None, @@ -292,7 +291,7 @@ pub mod chained { return self.update_with_key(key, newval, |_k, v, v1| ff(v,v1)); } - pure fn get(k: K) -> V { + pure fn get(&self, k: K) -> V { let opt_v = self.find(k); if opt_v.is_none() { die!(fmt!("Key not found in table: %?", k)); @@ -316,17 +315,17 @@ pub mod chained { } } - pure fn each_ref(blk: fn(key: &K, value: &V) -> bool) { + pure fn each_ref(&self, blk: fn(key: &K, value: &V) -> bool) { for self.each_entry |entry| { if !blk(&entry.key, &entry.value) { break; } } } - pure fn each_key_ref(blk: fn(key: &K) -> bool) { + pure fn each_key_ref(&self, blk: fn(key: &K) -> bool) { self.each_ref(|k, _v| blk(k)) } - pure fn each_value_ref(blk: fn(value: &V) -> bool) { + pure fn each_value_ref(&self, blk: fn(value: &V) -> bool) { self.each_ref(|_k, v| blk(v)) } } |
