diff options
| author | Kevin Ballard <kevin@sb.org> | 2014-05-03 22:55:35 -0700 |
|---|---|---|
| committer | Kevin Ballard <kevin@sb.org> | 2014-05-08 12:06:22 -0700 |
| commit | cc42b619362c344aacdb84ff00243b3e32168cad (patch) | |
| tree | 7c0aafbd4c9ebfe956b574ed8b71bf32aa31dcc2 /src/libstd | |
| parent | f340fb9b1292f519d0bf09019cd34e7068cc9618 (diff) | |
| download | rust-cc42b619362c344aacdb84ff00243b3e32168cad.tar.gz rust-cc42b619362c344aacdb84ff00243b3e32168cad.zip | |
Handle fallout in io::net::addrinfo, io::process, and rt::rtio
API Changes: - get_host_addresses() returns IoResult<Vec<IpAddr>> - Process.extra_io is Vec<Option<io::PipeStream>>
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/net/addrinfo.rs | 6 | ||||
| -rw-r--r-- | src/libstd/io/process.rs | 4 | ||||
| -rw-r--r-- | src/libstd/rt/rtio.rs | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/io/net/addrinfo.rs b/src/libstd/io/net/addrinfo.rs index 4006665e886..879c66e0769 100644 --- a/src/libstd/io/net/addrinfo.rs +++ b/src/libstd/io/net/addrinfo.rs @@ -24,7 +24,7 @@ use io::IoResult; use io::net::ip::{SocketAddr, IpAddr}; use option::{Option, Some, None}; use rt::rtio::{IoFactory, LocalIo}; -use slice::OwnedVector; +use vec::Vec; /// Hints to the types of sockets that are desired when looking up hosts pub enum SocketType { @@ -73,7 +73,7 @@ pub struct Info { /// Easy name resolution. Given a hostname, returns the list of IP addresses for /// that hostname. -pub fn get_host_addresses(host: &str) -> IoResult<~[IpAddr]> { +pub fn get_host_addresses(host: &str) -> IoResult<Vec<IpAddr>> { lookup(Some(host), None, None).map(|a| a.move_iter().map(|i| i.address.ip).collect()) } @@ -90,7 +90,7 @@ pub fn get_host_addresses(host: &str) -> IoResult<~[IpAddr]> { /// FIXME: this is not public because the `Hint` structure is not ready for public /// consumption just yet. fn lookup(hostname: Option<&str>, servname: Option<&str>, hint: Option<Hint>) - -> IoResult<~[Info]> { + -> IoResult<Vec<Info>> { LocalIo::maybe_raise(|io| io.get_host_addresses(hostname, servname, hint)) } diff --git a/src/libstd/io/process.rs b/src/libstd/io/process.rs index 74f6944f102..3babef6126e 100644 --- a/src/libstd/io/process.rs +++ b/src/libstd/io/process.rs @@ -69,7 +69,7 @@ pub struct Process { /// Extra I/O handles as configured by the original `ProcessConfig` when /// this process was created. This is by default empty. - pub extra_io: ~[Option<io::PipeStream>], + pub extra_io: Vec<Option<io::PipeStream>>, } /// This configuration describes how a new process should be spawned. A blank @@ -418,7 +418,7 @@ impl Drop for Process { drop(self.stdin.take()); drop(self.stdout.take()); drop(self.stderr.take()); - drop(mem::replace(&mut self.extra_io, box [])); + drop(mem::replace(&mut self.extra_io, Vec::new())); self.wait(); } diff --git a/src/libstd/rt/rtio.rs b/src/libstd/rt/rtio.rs index 16882624ab7..eaf194b89cb 100644 --- a/src/libstd/rt/rtio.rs +++ b/src/libstd/rt/rtio.rs @@ -161,7 +161,7 @@ pub trait IoFactory { fn unix_connect(&mut self, path: &CString, timeout: Option<u64>) -> IoResult<Box<RtioPipe:Send>>; fn get_host_addresses(&mut self, host: Option<&str>, servname: Option<&str>, - hint: Option<ai::Hint>) -> IoResult<~[ai::Info]>; + hint: Option<ai::Hint>) -> IoResult<Vec<ai::Info>>; // filesystem operations fn fs_from_raw_fd(&mut self, fd: c_int, close: CloseBehavior) |
