diff options
| author | Aaron Turon <aturon@mozilla.com> | 2014-10-02 11:47:51 -0700 |
|---|---|---|
| committer | Aaron Turon <aturon@mozilla.com> | 2014-10-02 11:47:51 -0700 |
| commit | 7bf56df4c8bf40a16f2743447b7688343642f370 (patch) | |
| tree | a3854d324e66cf84cc78d1a89faff4a6265a9058 /src/libstd/io | |
| parent | 2f365ffdad40475e8f70f7af7f210d6c597b60f5 (diff) | |
| download | rust-7bf56df4c8bf40a16f2743447b7688343642f370.tar.gz rust-7bf56df4c8bf40a16f2743447b7688343642f370.zip | |
Revert "Put slicing syntax behind a feature gate."
This reverts commit 95cfc35607ccf5f02f02de56a35a9ef50fa23a82.
Diffstat (limited to 'src/libstd/io')
| -rw-r--r-- | src/libstd/io/net/udp.rs | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/src/libstd/io/net/udp.rs b/src/libstd/io/net/udp.rs index b8fb187548c..4dd6f448ee5 100644 --- a/src/libstd/io/net/udp.rs +++ b/src/libstd/io/net/udp.rs @@ -35,29 +35,26 @@ use rt::rtio; /// /// ```rust,no_run /// # #![allow(unused_must_use)] -/// #![feature(slicing_syntax)] -/// /// use std::io::net::udp::UdpSocket; /// use std::io::net::ip::{Ipv4Addr, SocketAddr}; -/// fn main() { -/// let addr = SocketAddr { ip: Ipv4Addr(127, 0, 0, 1), port: 34254 }; -/// let mut socket = match UdpSocket::bind(addr) { -/// Ok(s) => s, -/// Err(e) => fail!("couldn't bind socket: {}", e), -/// }; /// -/// let mut buf = [0, ..10]; -/// match socket.recv_from(buf) { -/// Ok((amt, src)) => { -/// // Send a reply to the socket we received data from -/// let buf = buf[mut ..amt]; -/// buf.reverse(); -/// socket.send_to(buf, src); -/// } -/// Err(e) => println!("couldn't receive a datagram: {}", e) +/// let addr = SocketAddr { ip: Ipv4Addr(127, 0, 0, 1), port: 34254 }; +/// let mut socket = match UdpSocket::bind(addr) { +/// Ok(s) => s, +/// Err(e) => fail!("couldn't bind socket: {}", e), +/// }; +/// +/// let mut buf = [0, ..10]; +/// match socket.recv_from(buf) { +/// Ok((amt, src)) => { +/// // Send a reply to the socket we received data from +/// let buf = buf[mut ..amt]; +/// buf.reverse(); +/// socket.send_to(buf, src); /// } -/// drop(socket); // close the socket +/// Err(e) => println!("couldn't receive a datagram: {}", e) /// } +/// drop(socket); // close the socket /// ``` pub struct UdpSocket { obj: Box<RtioUdpSocket + Send>, |
