]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_back/sha2.rs
remove unnecessary parentheses from range notation
[rust.git] / src / librustc_back / sha2.rs
index f33971a6ac0c2f2e4ad6f0e310bf22eed39a186d..0228098b8f8384c4aad7eb4068b401504d372381 100644 (file)
@@ -140,7 +140,7 @@ fn input<F>(&mut self, input: &[u8], mut func: F) where
             if input.len() >= buffer_remaining {
                     copy_memory(
                         self.buffer.slice_mut(self.buffer_idx, size),
-                        input.index(&(0..buffer_remaining)));
+                        &input[..buffer_remaining]);
                 self.buffer_idx = 0;
                 func(&self.buffer);
                 i += buffer_remaining;
@@ -156,7 +156,7 @@ fn input<F>(&mut self, input: &[u8], mut func: F) where
         // While we have at least a full buffer size chunk's worth of data, process that data
         // without copying it into the buffer
         while input.len() - i >= size {
-            func(input.index(&(i..(i + size))));
+            func(&input[i..i + size]);
             i += size;
         }
 
@@ -166,7 +166,7 @@ fn input<F>(&mut self, input: &[u8], mut func: F) where
         let input_remaining = input.len() - i;
         copy_memory(
             self.buffer.slice_to_mut(input_remaining),
-            input.index(&(i..)));
+            &input[i..]);
         self.buffer_idx += input_remaining;
     }
 
@@ -188,7 +188,7 @@ fn next<'s>(&'s mut self, len: uint) -> &'s mut [u8] {
     fn full_buffer<'s>(&'s mut self) -> &'s [u8] {
         assert!(self.buffer_idx == 64);
         self.buffer_idx = 0;
-        return self.buffer.index(&(0..64));
+        return &self.buffer[..64];
     }
 
     fn position(&self) -> uint { self.buffer_idx }