Skip to content

Commit 119c780

Browse files
committed
oldmap: start conversion to explicit self
1 parent 81b4f36 commit 119c780

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/libstd/oldmap.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use core::io::WriterUtil;
1818
use core::io;
1919
use core::ops;
2020
use core::to_str::ToStr;
21-
use core::mutable::Mut;
2221
use core::prelude::*;
2322
use core::to_bytes::IterBytes;
2423
use core::uint;
@@ -175,7 +174,7 @@ pub mod chained {
175174
}
176175

177176
impl<K:Eq IterBytes Hash Copy, V: Copy> T<K, V> {
178-
pure fn contains_key_ref(k: &K) -> bool {
177+
pure fn contains_key_ref(&self, k: &K) -> bool {
179178
let hash = k.hash_keyed(0,0) as uint;
180179
match self.search_tbl(k, hash) {
181180
NotFound => false,
@@ -227,7 +226,7 @@ pub mod chained {
227226
}
228227
}
229228

230-
pure fn find(k: K) -> Option<V> {
229+
pure fn find(&self, k: K) -> Option<V> {
231230
unsafe {
232231
match self.search_tbl(&k, k.hash_keyed(0,0) as uint) {
233232
NotFound => None,
@@ -292,7 +291,7 @@ pub mod chained {
292291
return self.update_with_key(key, newval, |_k, v, v1| ff(v,v1));
293292
}
294293

295-
pure fn get(k: K) -> V {
294+
pure fn get(&self, k: K) -> V {
296295
let opt_v = self.find(k);
297296
if opt_v.is_none() {
298297
die!(fmt!("Key not found in table: %?", k));
@@ -316,17 +315,17 @@ pub mod chained {
316315
}
317316
}
318317

319-
pure fn each_ref(blk: fn(key: &K, value: &V) -> bool) {
318+
pure fn each_ref(&self, blk: fn(key: &K, value: &V) -> bool) {
320319
for self.each_entry |entry| {
321320
if !blk(&entry.key, &entry.value) { break; }
322321
}
323322
}
324323

325-
pure fn each_key_ref(blk: fn(key: &K) -> bool) {
324+
pure fn each_key_ref(&self, blk: fn(key: &K) -> bool) {
326325
self.each_ref(|k, _v| blk(k))
327326
}
328327

329-
pure fn each_value_ref(blk: fn(value: &V) -> bool) {
328+
pure fn each_value_ref(&self, blk: fn(value: &V) -> bool) {
330329
self.each_ref(|_k, v| blk(v))
331330
}
332331
}

0 commit comments

Comments
 (0)