diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2015-01-02 13:56:28 +1300 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2015-01-07 10:46:33 +1300 |
| commit | f7ff37e4c52a1d6562635fcd5bab6309cf75ea08 (patch) | |
| tree | 9c69736bf3830f9048f61d45943bf0fa6326782d /src/libstd/rt | |
| parent | 918255ef8c3c21b2009204c3019239f8dc9f46bf (diff) | |
| download | rust-f7ff37e4c52a1d6562635fcd5bab6309cf75ea08.tar.gz rust-f7ff37e4c52a1d6562635fcd5bab6309cf75ea08.zip | |
Replace full slice notation with index calls
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/unwind.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rt/util.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/rt/unwind.rs b/src/libstd/rt/unwind.rs index 71169386c18..fd84f220942 100644 --- a/src/libstd/rt/unwind.rs +++ b/src/libstd/rt/unwind.rs @@ -544,7 +544,7 @@ fn begin_unwind_inner(msg: Box<Any + Send>, file_line: &(&'static str, uint)) -> // MAX_CALLBACKS, so we're sure to clamp it as necessary. let callbacks = { let amt = CALLBACK_CNT.load(Ordering::SeqCst); - CALLBACKS[..cmp::min(amt, MAX_CALLBACKS)] + CALLBACKS.index(&(0..cmp::min(amt, MAX_CALLBACKS))) }; for cb in callbacks.iter() { match cb.load(Ordering::SeqCst) { diff --git a/src/libstd/rt/util.rs b/src/libstd/rt/util.rs index bc01ce926f8..59f654a95ca 100644 --- a/src/libstd/rt/util.rs +++ b/src/libstd/rt/util.rs @@ -131,7 +131,7 @@ pub fn abort(args: fmt::Arguments) -> ! { impl<'a> fmt::Writer for BufWriter<'a> { fn write_str(&mut self, bytes: &str) -> fmt::Result { let left = self.buf.slice_from_mut(self.pos); - let to_write = bytes.as_bytes()[..cmp::min(bytes.len(), left.len())]; + let to_write = bytes.as_bytes().index(&(0..cmp::min(bytes.len(), left.len()))); slice::bytes::copy_memory(left, to_write); self.pos += to_write.len(); Ok(()) @@ -142,7 +142,7 @@ pub fn abort(args: fmt::Arguments) -> ! { let mut msg = [0u8; 512]; let mut w = BufWriter { buf: &mut msg, pos: 0 }; let _ = write!(&mut w, "{}", args); - let msg = str::from_utf8(w.buf[mut ..w.pos]).unwrap_or("aborted"); + let msg = str::from_utf8(w.buf.index_mut(&(0..w.pos))).unwrap_or("aborted"); let msg = if msg.is_empty() {"aborted"} else {msg}; // Give some context to the message |
