From 8e9f8f924cda8193ce1416c45cdcfce35fa6b8d1 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 29 Oct 2014 15:26:29 -0700 Subject: collections: impl Deref for Vec/String This commit adds the following impls: impl Deref<[T]> for Vec impl DerefMut<[T]> for Vec impl Deref 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 --- src/libstd/io/comm_adapters.rs | 2 +- src/libstd/io/net/addrinfo.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libstd/io') 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) // permission without help of apk #[cfg(all(test, not(target_os = "android")))] mod test { + use prelude::*; use super::*; use io::net::ip::*; -- cgit 1.4.1-3-g733a5