diff options
Diffstat (limited to 'src/libstd/net_tcp.rs')
| -rw-r--r-- | src/libstd/net_tcp.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/libstd/net_tcp.rs b/src/libstd/net_tcp.rs index 128490048db..17ffae1b5f4 100644 --- a/src/libstd/net_tcp.rs +++ b/src/libstd/net_tcp.rs @@ -248,7 +248,7 @@ fn connect(-input_ip: ip::ip_addr, port: uint, * # Arguments * * * sock - a `tcp_socket` to write to - * * raw_write_data - a vector of `[u8]/~` that will be written to the stream. + * * raw_write_data - a vector of `~[u8]` that will be written to the stream. * This value must remain valid for the duration of the `write` call * * # Returns @@ -284,7 +284,7 @@ fn write(sock: tcp_socket, raw_write_data: ~[u8]) * # Arguments * * * sock - a `tcp_socket` to write to - * * raw_write_data - a vector of `[u8]/~` that will be written to the stream. + * * raw_write_data - a vector of `~[u8]` that will be written to the stream. * This value must remain valid for the duration of the `write` call * * # Returns @@ -331,7 +331,7 @@ fn read_start(sock: tcp_socket) * * `sock` - a `net::tcp::tcp_socket` that you wish to stop reading on */ fn read_stop(sock: tcp_socket, - -read_port: comm::port<result::result<[u8]/~, tcp_err_data>>) -> + -read_port: comm::port<result::result<~[u8], tcp_err_data>>) -> result::result<(), tcp_err_data> unsafe { log(debug, #fmt("taking the read_port out of commission %?", read_port)); let socket_data = ptr::addr_of(*sock.socket_data); @@ -360,7 +360,7 @@ fn read(sock: tcp_socket, timeout_msecs: uint) } /** - * Reads a single chunk of data; returns a `future::future<[u8]/~>` + * Reads a single chunk of data; returns a `future::future<~[u8]>` * immediately * * Does a non-blocking read operation for a single chunk of data from a @@ -731,7 +731,7 @@ fn listen_common(-host_ip: ip::ip_addr, port: uint, backlog: uint, * A buffered wrapper that you can cast as an `io::reader` or `io::writer` */ fn socket_buf(-sock: tcp_socket) -> tcp_socket_buf { - tcp_socket_buf(@{ sock: sock, mut buf: []/~ }) + tcp_socket_buf(@{ sock: sock, mut buf: ~[] }) } /// Convenience methods extending `net::tcp::tcp_socket` @@ -741,7 +741,7 @@ impl tcp_socket for tcp_socket { read_start(self) } fn read_stop(-read_port: - comm::port<result::result<[u8]/~, tcp_err_data>>) -> + comm::port<result::result<~[u8], tcp_err_data>>) -> result::result<(), tcp_err_data> { read_stop(self, read_port) } @@ -765,14 +765,14 @@ impl tcp_socket for tcp_socket { /// Implementation of `io::reader` iface for a buffered `net::tcp::tcp_socket` impl tcp_socket_buf of io::reader for @tcp_socket_buf { - fn read_bytes(amt: uint) -> [u8]/~ { + fn read_bytes(amt: uint) -> ~[u8] { let has_amt_available = vec::len((*(self.data)).buf) >= amt; if has_amt_available { // no arbitrary-length shift in vec::? - let mut ret_buf = []/~; + let mut ret_buf = ~[]; while vec::len(ret_buf) < amt { - ret_buf += [vec::shift((*(self.data)).buf)]/~; + ret_buf += ~[vec::shift((*(self.data)).buf)]; } ret_buf } @@ -782,7 +782,7 @@ impl tcp_socket_buf of io::reader for @tcp_socket_buf { let err_data = read_result.get_err(); log(debug, #fmt("ERROR sock_buf as io::reader.read err %? %?", err_data.err_name, err_data.err_msg)); - []/~ + ~[] } else { let new_chunk = result::unwrap(read_result); @@ -811,7 +811,7 @@ impl tcp_socket_buf of io::reader for @tcp_socket_buf { /// Implementation of `io::reader` iface for a buffered `net::tcp::tcp_socket` impl tcp_socket_buf of io::writer for @tcp_socket_buf { - fn write(data: [const u8]/&) unsafe { + fn write(data: &[const u8]) unsafe { let socket_data_ptr = ptr::addr_of(*((*(self.data)).sock).socket_data); let w_result = write_common_impl(socket_data_ptr, @@ -1221,7 +1221,7 @@ type tcp_socket_data = { type tcp_buffered_socket_data = { sock: tcp_socket, - mut buf: [u8]/~ + mut buf: ~[u8] }; //#[cfg(test)] |
