summary refs log tree commit diff
path: root/src/libstd/smallintmap.rs
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2012-03-14 14:03:56 -0400
committerNiko Matsakis <niko@alum.mit.edu>2012-03-14 20:46:36 -0400
commit6b35875dca67e5dd1e8f986c8528ffbf973fdcbb (patch)
treed36cb21cbe8dde663f0f381ad9ce70c9c50fc295 /src/libstd/smallintmap.rs
parent273c5e5f1129949db780619901fe54b9a3d1fecf (diff)
downloadrust-6b35875dca67e5dd1e8f986c8528ffbf973fdcbb.tar.gz
rust-6b35875dca67e5dd1e8f986c8528ffbf973fdcbb.zip
annotate libstd and start enforcing mutability
Diffstat (limited to 'src/libstd/smallintmap.rs')
-rw-r--r--src/libstd/smallintmap.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/smallintmap.rs b/src/libstd/smallintmap.rs
index 3ddc2bb5d6e..e90fb1abd96 100644
--- a/src/libstd/smallintmap.rs
+++ b/src/libstd/smallintmap.rs
@@ -66,7 +66,7 @@ fn max_key<T>(m: smallintmap<T>) -> uint {
 #[doc = "Implements the map::map interface for smallintmap"]
 impl <V: copy> of map::map<uint, V> for smallintmap<V> {
     fn size() -> uint {
-        let sz = 0u;
+        let mut sz = 0u;
         for item in self.v {
             alt item { some(_) { sz += 1u; } _ {} }
         }
@@ -90,7 +90,7 @@ impl <V: copy> of map::map<uint, V> for smallintmap<V> {
     fn find(&&key: uint) -> option<V> { find(self, key) }
     fn rehash() { fail }
     fn items(it: fn(&&uint, V)) {
-        let idx = 0u;
+        let mut idx = 0u;
         for item in self.v {
             alt item {
               some(elt) {
@@ -102,7 +102,7 @@ impl <V: copy> of map::map<uint, V> for smallintmap<V> {
         }
     }
     fn keys(it: fn(&&uint)) {
-        let idx = 0u;
+        let mut idx = 0u;
         for item in self.v {
             if item != none { it(idx); }
             idx += 1u;