about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-10-29 15:26:29 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-10-29 18:48:30 -0700
commit8e9f8f924cda8193ce1416c45cdcfce35fa6b8d1 (patch)
tree40ec9f2a5a002ed52f03e74b1c316e250c316172 /src/libstd
parentdd7113609c17cc31fee4b54d954e71e01af3bcc9 (diff)
downloadrust-8e9f8f924cda8193ce1416c45cdcfce35fa6b8d1.tar.gz
rust-8e9f8f924cda8193ce1416c45cdcfce35fa6b8d1.zip
collections: impl Deref for Vec/String
This commit adds the following impls:

    impl<T> Deref<[T]> for Vec<T>
    impl<T> DerefMut<[T]> for Vec<T>
    impl Deref<str> for String

This commit also removes all duplicated inherent methods from vectors and
strings as implementations will now silently call through to the slice
implementation. Some breakage occurred at std and beneath due to inherent
methods removed in favor of those in the slice traits and std doesn't use its
own prelude,

cc #18424
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/io/comm_adapters.rs2
-rw-r--r--src/libstd/io/net/addrinfo.rs1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/libstd/io/comm_adapters.rs b/src/libstd/io/comm_adapters.rs
index bd9577c8cfc..338d293fa0a 100644
--- a/src/libstd/io/comm_adapters.rs
+++ b/src/libstd/io/comm_adapters.rs
@@ -15,7 +15,7 @@ use comm::{Sender, Receiver};
 use io;
 use option::{None, Some};
 use result::{Ok, Err};
-use slice::{bytes, CloneableVector};
+use slice::{bytes, CloneableVector, ImmutableSlice};
 use super::{Buffer, Reader, Writer, IoResult};
 use vec::Vec;
 
diff --git a/src/libstd/io/net/addrinfo.rs b/src/libstd/io/net/addrinfo.rs
index 9d85701eb29..eaf47bb004c 100644
--- a/src/libstd/io/net/addrinfo.rs
+++ b/src/libstd/io/net/addrinfo.rs
@@ -125,6 +125,7 @@ fn lookup(hostname: Option<&str>, servname: Option<&str>, hint: Option<Hint>)
 // permission without help of apk
 #[cfg(all(test, not(target_os = "android")))]
 mod test {
+    use prelude::*;
     use super::*;
     use io::net::ip::*;