about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/bitv.rs10
-rw-r--r--src/libstd/ebml.rs8
2 files changed, 9 insertions, 9 deletions
diff --git a/src/libstd/bitv.rs b/src/libstd/bitv.rs
index 3acc95a3aad..8bac0fed3c9 100644
--- a/src/libstd/bitv.rs
+++ b/src/libstd/bitv.rs
@@ -437,7 +437,8 @@ pub impl Bitv {
             if offset >= bitv.nbits {
                 0
             } else {
-                bitv[offset] as u8 << (7 - bit)
+                // NOTE cannot use bitv[offset] until snapshot
+                bitv.index(&offset) as u8 << (7 - bit)
             }
         }
 
@@ -459,7 +460,8 @@ pub impl Bitv {
      * Transform self into a [bool] by turning each bit into a bool
      */
     fn to_bools(&self) -> ~[bool] {
-        vec::from_fn(self.nbits, |i| self[i])
+        // NOTE cannot use self[i] until snapshot
+        vec::from_fn(self.nbits, |i| self.index(&i))
     }
 
     /**
@@ -555,8 +557,8 @@ pub fn from_fn(len: uint, f: &fn(index: uint) -> bool) -> Bitv {
 }
 
 impl ops::Index<uint,bool> for Bitv {
-    fn index(&self, i: uint) -> bool {
-        self.get(i)
+    fn index(&self, i: &uint) -> bool {
+        self.get(*i)
     }
 }
 
diff --git a/src/libstd/ebml.rs b/src/libstd/ebml.rs
index 92898af2993..b82616d386a 100644
--- a/src/libstd/ebml.rs
+++ b/src/libstd/ebml.rs
@@ -68,11 +68,9 @@ pub mod reader {
 
     // ebml reading
 
-    impl ops::Index<uint,Doc> for Doc {
-        fn index(&self, tag: uint) -> Doc {
-            unsafe {
-                get_doc(*self, tag)
-            }
+    pub impl Doc {
+        fn get(&self, tag: uint) -> Doc {
+            get_doc(*self, tag)
         }
     }