diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-03-21 21:34:30 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-03-22 10:29:17 -0700 |
| commit | c1084091d4e5472fac7e158b11120bad6ff210ff (patch) | |
| tree | 745a42f03c8c88670da739313cd8050a5f1d8b37 /src/libstd/smallintmap.rs | |
| parent | be9bddd46377bc982b73acf15a720365a54197a7 (diff) | |
| download | rust-c1084091d4e5472fac7e158b11120bad6ff210ff.tar.gz rust-c1084091d4e5472fac7e158b11120bad6ff210ff.zip | |
libstd: Remove all uses of `pure` from libstd. rs=depure
Diffstat (limited to 'src/libstd/smallintmap.rs')
| -rw-r--r-- | src/libstd/smallintmap.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libstd/smallintmap.rs b/src/libstd/smallintmap.rs index 6a6635bae90..a559e7540d4 100644 --- a/src/libstd/smallintmap.rs +++ b/src/libstd/smallintmap.rs @@ -24,7 +24,7 @@ pub struct SmallIntMap<T> { impl<V> BaseIter<(uint, &'self V)> for SmallIntMap<V> { /// Visit all key-value pairs in order - pure fn each(&self, it: &fn(&(uint, &'self V)) -> bool) { + fn each(&self, it: &fn(&(uint, &'self V)) -> bool) { for uint::range(0, self.v.len()) |i| { match self.v[i] { Some(ref elt) => if !it(&(i, elt)) { break }, @@ -33,12 +33,12 @@ impl<V> BaseIter<(uint, &'self V)> for SmallIntMap<V> { } } - pure fn size_hint(&self) -> Option<uint> { Some(self.len()) } + fn size_hint(&self) -> Option<uint> { Some(self.len()) } } impl<V> ReverseIter<(uint, &'self V)> for SmallIntMap<V> { /// Visit all key-value pairs in reverse order - pure fn each_reverse(&self, it: &fn(&(uint, &'self V)) -> bool) { + fn each_reverse(&self, it: &fn(&(uint, &'self V)) -> bool) { for uint::range_rev(self.v.len(), 0) |i| { match self.v[i - 1] { Some(ref elt) => if !it(&(i - 1, elt)) { break }, @@ -50,7 +50,7 @@ impl<V> ReverseIter<(uint, &'self V)> for SmallIntMap<V> { impl<V> Container for SmallIntMap<V> { /// Return the number of elements in the map - pure fn len(&const self) -> uint { + fn len(&const self) -> uint { let mut sz = 0; for uint::range(0, vec::uniq_len(&const self.v)) |i| { match self.v[i] { @@ -62,7 +62,7 @@ impl<V> Container for SmallIntMap<V> { } /// Return true if the map contains no elements - pure fn is_empty(&const self) -> bool { self.len() == 0 } + fn is_empty(&const self) -> bool { self.len() == 0 } } impl<V> Mutable for SmallIntMap<V> { @@ -72,17 +72,17 @@ impl<V> Mutable for SmallIntMap<V> { impl<V> Map<uint, V> for SmallIntMap<V> { /// Return true if the map contains a value for the specified key - pure fn contains_key(&self, key: &uint) -> bool { + fn contains_key(&self, key: &uint) -> bool { self.find(key).is_some() } /// Visit all keys in order - pure fn each_key(&self, blk: &fn(key: &uint) -> bool) { + fn each_key(&self, blk: &fn(key: &uint) -> bool) { self.each(|&(k, _)| blk(&k)) } /// Visit all values in order - pure fn each_value(&self, blk: &fn(value: &V) -> bool) { + fn each_value(&self, blk: &fn(value: &V) -> bool) { self.each(|&(_, v)| blk(v)) } @@ -97,7 +97,7 @@ impl<V> Map<uint, V> for SmallIntMap<V> { } /// Iterate over the map and mutate the contained values - pure fn find(&self, key: &uint) -> Option<&'self V> { + fn find(&self, key: &uint) -> Option<&'self V> { if *key < self.v.len() { match self.v[*key] { Some(ref value) => Some(value), @@ -135,9 +135,9 @@ impl<V> Map<uint, V> for SmallIntMap<V> { pub impl<V> SmallIntMap<V> { /// Create an empty SmallIntMap - pure fn new() -> SmallIntMap<V> { SmallIntMap{v: ~[]} } + fn new() -> SmallIntMap<V> { SmallIntMap{v: ~[]} } - pure fn get(&self, key: &uint) -> &'self V { + fn get(&self, key: &uint) -> &'self V { self.find(key).expect("key not present") } } |
