diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2014-03-08 18:11:52 -0500 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2014-03-20 01:30:27 -0400 |
| commit | ce620320a20baa1428e679c751b1b4a8d8556ca1 (patch) | |
| tree | f28a0234fe5f1d9509ef6cfa0c92448f7f29f7ec /src/libstd/io | |
| parent | 4ca51aeea7187a63b987129d67cf7d348b6c60a9 (diff) | |
| download | rust-ce620320a20baa1428e679c751b1b4a8d8556ca1.tar.gz rust-ce620320a20baa1428e679c751b1b4a8d8556ca1.zip | |
rename std::vec -> std::slice
Closes #12702
Diffstat (limited to 'src/libstd/io')
| -rw-r--r-- | src/libstd/io/buffered.rs | 12 | ||||
| -rw-r--r-- | src/libstd/io/comm_adapters.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/extensions.rs | 8 | ||||
| -rw-r--r-- | src/libstd/io/fs.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/mem.rs | 14 | ||||
| -rw-r--r-- | src/libstd/io/mod.rs | 8 | ||||
| -rw-r--r-- | src/libstd/io/net/addrinfo.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/net/ip.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/signal.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/stdio.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/util.rs | 2 |
11 files changed, 28 insertions, 28 deletions
diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index 3ae44e4a1b5..ab9a8377136 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -17,8 +17,8 @@ use iter::ExactSize; use ops::Drop; use option::{Some, None, Option}; use result::{Ok, Err}; -use vec::{OwnedVector, ImmutableVector, MutableVector}; -use vec; +use slice::{OwnedVector, ImmutableVector, MutableVector}; +use slice; /// Wraps a Reader and buffers input from it /// @@ -58,7 +58,7 @@ impl<R: Reader> BufferedReader<R> { // everything up-front. This allows creation of BufferedReader instances // to be very cheap (large mallocs are not nearly as expensive as large // callocs). - let mut buf = vec::with_capacity(cap); + let mut buf = slice::with_capacity(cap); unsafe { buf.set_len(cap); } BufferedReader { inner: inner, @@ -106,7 +106,7 @@ impl<R: Reader> Reader for BufferedReader<R> { let nread = { let available = try!(self.fill()); let nread = cmp::min(available.len(), buf.len()); - vec::bytes::copy_memory(buf, available.slice_to(nread)); + slice::bytes::copy_memory(buf, available.slice_to(nread)); nread }; self.pos += nread; @@ -140,7 +140,7 @@ impl<W: Writer> BufferedWriter<W> { /// Creates a new `BufferedWriter` with the specified buffer capacity pub fn with_capacity(cap: uint, inner: W) -> BufferedWriter<W> { // See comments in BufferedReader for why this uses unsafe code. - let mut buf = vec::with_capacity(cap); + let mut buf = slice::with_capacity(cap); unsafe { buf.set_len(cap); } BufferedWriter { inner: Some(inner), @@ -190,7 +190,7 @@ impl<W: Writer> Writer for BufferedWriter<W> { self.inner.get_mut_ref().write(buf) } else { let dst = self.buf.mut_slice_from(self.pos); - vec::bytes::copy_memory(dst, buf); + slice::bytes::copy_memory(dst, buf); self.pos += buf.len(); Ok(()) } diff --git a/src/libstd/io/comm_adapters.rs b/src/libstd/io/comm_adapters.rs index f09555e93a0..075c65e04be 100644 --- a/src/libstd/io/comm_adapters.rs +++ b/src/libstd/io/comm_adapters.rs @@ -16,7 +16,7 @@ use io; use option::{None, Option, Some}; use result::{Ok, Err}; use super::{Reader, Writer, IoResult}; -use vec::{bytes, CloneableVector, MutableVector, ImmutableVector}; +use slice::{bytes, CloneableVector, MutableVector, ImmutableVector}; /// Allows reading from a rx. /// diff --git a/src/libstd/io/extensions.rs b/src/libstd/io/extensions.rs index f7cab755714..070cbd569e6 100644 --- a/src/libstd/io/extensions.rs +++ b/src/libstd/io/extensions.rs @@ -21,7 +21,7 @@ use option::{Option, Some, None}; use result::{Ok, Err}; use io; use io::{IoError, IoResult, Reader}; -use vec::{OwnedVector, ImmutableVector}; +use slice::{OwnedVector, ImmutableVector}; use ptr::RawPtr; /// An iterator that reads a single byte on each iteration, @@ -114,7 +114,7 @@ pub fn u64_from_be_bytes(data: &[u8], -> u64 { use ptr::{copy_nonoverlapping_memory}; use mem::from_be64; - use vec::MutableVector; + use slice::MutableVector; assert!(size <= 8u); @@ -470,10 +470,10 @@ mod bench { macro_rules! u64_from_be_bytes_bench_impl( ($size:expr, $stride:expr, $start_index:expr) => ({ - use vec; + use slice; use super::u64_from_be_bytes; - let data = vec::from_fn($stride*100+$start_index, |i| i as u8); + let data = slice::from_fn($stride*100+$start_index, |i| i as u8); let mut sum = 0u64; bh.iter(|| { let mut i = $start_index; diff --git a/src/libstd/io/fs.rs b/src/libstd/io/fs.rs index 3435c9a07aa..aab2f8c887c 100644 --- a/src/libstd/io/fs.rs +++ b/src/libstd/io/fs.rs @@ -62,7 +62,7 @@ use option::{Some, None, Option}; use result::{Ok, Err}; use path; use path::{Path, GenericPath}; -use vec::{OwnedVector, ImmutableVector}; +use slice::{OwnedVector, ImmutableVector}; use vec_ng::Vec; /// Unconstrained file access type that exposes read and write operations diff --git a/src/libstd/io/mem.rs b/src/libstd/io/mem.rs index 3e79225f9ab..d0c4ef308b3 100644 --- a/src/libstd/io/mem.rs +++ b/src/libstd/io/mem.rs @@ -16,8 +16,8 @@ use option::None; use result::{Err, Ok}; use io; use io::{Reader, Writer, Seek, Buffer, IoError, SeekStyle, IoResult}; -use vec; -use vec::{Vector, ImmutableVector, MutableVector, OwnedCloneableVector}; +use slice; +use slice::{Vector, ImmutableVector, MutableVector, OwnedCloneableVector}; fn combine(seek: SeekStyle, cur: uint, end: uint, offset: i64) -> IoResult<u64> { // compute offset as signed and clamp to prevent overflow @@ -64,7 +64,7 @@ impl MemWriter { /// Create a new `MemWriter`, allocating at least `n` bytes for /// the internal buffer. pub fn with_capacity(n: uint) -> MemWriter { - MemWriter { buf: vec::with_capacity(n), pos: 0 } + MemWriter { buf: slice::with_capacity(n), pos: 0 } } /// Acquires an immutable reference to the underlying buffer of this @@ -98,7 +98,7 @@ impl Writer for MemWriter { // Do the necessary writes if left.len() > 0 { - vec::bytes::copy_memory(self.buf.mut_slice_from(self.pos), left); + slice::bytes::copy_memory(self.buf.mut_slice_from(self.pos), left); } if right.len() > 0 { self.buf.push_all(right); @@ -171,7 +171,7 @@ impl Reader for MemReader { let input = self.buf.slice(self.pos, self.pos + write_len); let output = buf.mut_slice(0, write_len); assert_eq!(input.len(), output.len()); - vec::bytes::copy_memory(output, input); + slice::bytes::copy_memory(output, input); } self.pos += write_len; assert!(self.pos <= self.buf.len()); @@ -246,7 +246,7 @@ impl<'a> Writer for BufWriter<'a> { }) } - vec::bytes::copy_memory(self.buf.mut_slice_from(self.pos), buf); + slice::bytes::copy_memory(self.buf.mut_slice_from(self.pos), buf); self.pos += buf.len(); Ok(()) } @@ -303,7 +303,7 @@ impl<'a> Reader for BufReader<'a> { let input = self.buf.slice(self.pos, self.pos + write_len); let output = buf.mut_slice(0, write_len); assert_eq!(input.len(), output.len()); - vec::bytes::copy_memory(output, input); + slice::bytes::copy_memory(output, input); } self.pos += write_len; assert!(self.pos <= self.buf.len()); diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index c18d4e273c4..cbced77d014 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -223,8 +223,8 @@ use str::{StrSlice, OwnedStr}; use str; use uint; use unstable::finally::try_finally; -use vec::{OwnedVector, MutableVector, ImmutableVector, OwnedCloneableVector}; -use vec; +use slice::{OwnedVector, MutableVector, ImmutableVector, OwnedCloneableVector}; +use slice; // Reexports pub use self::stdio::stdin; @@ -406,7 +406,7 @@ pub trait Reader { /// (not returned as part of the error). If this is unacceptable, then it is /// recommended to use the `push_bytes` or `read` methods. fn read_bytes(&mut self, len: uint) -> IoResult<~[u8]> { - let mut buf = vec::with_capacity(len); + let mut buf = slice::with_capacity(len); match self.push_bytes(&mut buf, len) { Ok(()) => Ok(buf), Err(e) => Err(e), @@ -422,7 +422,7 @@ pub trait Reader { /// /// When EOF is encountered, all bytes read up to that point are returned. fn read_to_end(&mut self) -> IoResult<~[u8]> { - let mut buf = vec::with_capacity(DEFAULT_BUF_SIZE); + let mut buf = slice::with_capacity(DEFAULT_BUF_SIZE); loop { match self.push_bytes(&mut buf, DEFAULT_BUF_SIZE) { Ok(()) => {} diff --git a/src/libstd/io/net/addrinfo.rs b/src/libstd/io/net/addrinfo.rs index 80ca353523f..6e0b766a587 100644 --- a/src/libstd/io/net/addrinfo.rs +++ b/src/libstd/io/net/addrinfo.rs @@ -23,7 +23,7 @@ use io::IoResult; use io::net::ip::{SocketAddr, IpAddr}; use option::{Option, Some, None}; use rt::rtio::{IoFactory, LocalIo}; -use vec::ImmutableVector; +use slice::ImmutableVector; /// Hints to the types of sockets that are desired when looking up hosts pub enum SocketType { diff --git a/src/libstd/io/net/ip.rs b/src/libstd/io/net/ip.rs index 7c9321d87d9..dc24ead6258 100644 --- a/src/libstd/io/net/ip.rs +++ b/src/libstd/io/net/ip.rs @@ -16,7 +16,7 @@ use from_str::FromStr; use iter::Iterator; use option::{Option, None, Some}; use str::StrSlice; -use vec::{MutableCloneableVector, ImmutableVector, MutableVector}; +use slice::{MutableCloneableVector, ImmutableVector, MutableVector}; pub type Port = u16; diff --git a/src/libstd/io/signal.rs b/src/libstd/io/signal.rs index c66fcd13917..d6700fda23d 100644 --- a/src/libstd/io/signal.rs +++ b/src/libstd/io/signal.rs @@ -27,7 +27,7 @@ use mem::drop; use option::{Some, None}; use result::{Ok, Err}; use rt::rtio::{IoFactory, LocalIo, RtioSignal}; -use vec::{ImmutableVector, OwnedVector}; +use slice::{ImmutableVector, OwnedVector}; /// Signals that can be sent and received #[repr(int)] diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs index 7c65e76ab47..2389a8655f3 100644 --- a/src/libstd/io/stdio.rs +++ b/src/libstd/io/stdio.rs @@ -40,7 +40,7 @@ use rt::local::Local; use rt::rtio::{DontClose, IoFactory, LocalIo, RtioFileStream, RtioTTY}; use rt::task::Task; use str::StrSlice; -use vec::ImmutableVector; +use slice::ImmutableVector; // And so begins the tale of acquiring a uv handle to a stdio stream on all // platforms in all situations. Our story begins by splitting the world into two diff --git a/src/libstd/io/util.rs b/src/libstd/io/util.rs index d6d1de00d86..2df0dec2d13 100644 --- a/src/libstd/io/util.rs +++ b/src/libstd/io/util.rs @@ -13,7 +13,7 @@ use prelude::*; use cmp; use io; -use vec::bytes::MutableByteVector; +use slice::bytes::MutableByteVector; /// Wraps a `Reader`, limiting the number of bytes that can be read from it. pub struct LimitReader<R> { |
