diff options
Diffstat (limited to 'src/libstd/io/net/udp.rs')
| -rw-r--r-- | src/libstd/io/net/udp.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/io/net/udp.rs b/src/libstd/io/net/udp.rs index d6c379cc9f7..6c167359966 100644 --- a/src/libstd/io/net/udp.rs +++ b/src/libstd/io/net/udp.rs @@ -45,11 +45,11 @@ use sys_common; /// Err(e) => panic!("couldn't bind socket: {}", e), /// }; /// -/// let mut buf = [0, ..10]; +/// let mut buf = [0; 10]; /// match socket.recv_from(&mut buf) { /// Ok((amt, src)) => { /// // Send a reply to the socket we received data from -/// let buf = buf[mut ..amt]; +/// let buf = buf.slice_to_mut(amt); /// buf.reverse(); /// socket.send_to(buf, src); /// } @@ -347,7 +347,7 @@ mod test { let (tx2, rx2) = channel(); let _t = Thread::spawn(move|| { - let send_as = |ip, val: &[u8]| { + let send_as = |&:ip, val: &[u8]| { match UdpSocket::bind(ip) { Ok(client) => { let client = box client; @@ -602,7 +602,7 @@ mod test { a.set_write_timeout(Some(1000)); for _ in range(0u, 100) { - match a.send_to(&[0, ..4*1024], addr2) { + match a.send_to(&[0;4*1024], addr2) { Ok(()) | Err(IoError { kind: ShortWrite(..), .. }) => {}, Err(IoError { kind: TimedOut, .. }) => break, Err(e) => panic!("other error: {}", e), |
