diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2015-02-01 12:44:15 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2015-02-04 20:06:08 -0500 |
| commit | 571cc7f8e98da46735a5728387c768cde75d010c (patch) | |
| tree | 2260e6f54186e1876a093bc670535116233ef524 /src/libstd | |
| parent | ba2f13ef0667ce90f55ab0f1506bf5ee7b852d96 (diff) | |
| download | rust-571cc7f8e98da46735a5728387c768cde75d010c.tar.gz rust-571cc7f8e98da46735a5728387c768cde75d010c.zip | |
remove all kind annotations from closures
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/num/strconv.rs | 4 | ||||
| -rw-r--r-- | src/libstd/old_io/net/ip.rs | 20 | ||||
| -rw-r--r-- | src/libstd/old_io/process.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rt/args.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync/future.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sync/task_pool.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/common/helper_thread.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/common/net.rs | 14 | ||||
| -rw-r--r-- | src/libstd/sys/unix/pipe.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sys/unix/process.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sys/windows/process.rs | 2 | ||||
| -rw-r--r-- | src/libstd/thread.rs | 6 | ||||
| -rw-r--r-- | src/libstd/thunk.rs | 2 |
13 files changed, 38 insertions, 38 deletions
diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs index 9c4741b3ce3..4ae7d3437fd 100644 --- a/src/libstd/num/strconv.rs +++ b/src/libstd/num/strconv.rs @@ -321,10 +321,10 @@ pub fn float_to_str_bytes_common<T: Float>( // cut off the one extra digit, and depending on its value // round the remaining ones. if limit_digits && dig == digit_count { - let ascii2value = |&: chr: u8| { + let ascii2value = |chr: u8| { (chr as char).to_digit(radix).unwrap() }; - let value2ascii = |&: val: uint| { + let value2ascii = |val: uint| { char::from_digit(val, radix).unwrap() as u8 }; diff --git a/src/libstd/old_io/net/ip.rs b/src/libstd/old_io/net/ip.rs index d85251795c8..9c89c943994 100644 --- a/src/libstd/old_io/net/ip.rs +++ b/src/libstd/old_io/net/ip.rs @@ -323,25 +323,25 @@ impl<'a> Parser<'a> { } fn read_ip_addr(&mut self) -> Option<IpAddr> { - let ipv4_addr = |&mut: p: &mut Parser| p.read_ipv4_addr(); - let ipv6_addr = |&mut: p: &mut Parser| p.read_ipv6_addr(); + let ipv4_addr = |p: &mut Parser| p.read_ipv4_addr(); + let ipv6_addr = |p: &mut Parser| p.read_ipv6_addr(); self.read_or(&mut [box ipv4_addr, box ipv6_addr]) } fn read_socket_addr(&mut self) -> Option<SocketAddr> { - let ip_addr = |&: p: &mut Parser| { - let ipv4_p = |&mut: p: &mut Parser| p.read_ip_addr(); - let ipv6_p = |&mut: p: &mut Parser| { - let open_br = |&: p: &mut Parser| p.read_given_char('['); - let ip_addr = |&: p: &mut Parser| p.read_ipv6_addr(); - let clos_br = |&: p: &mut Parser| p.read_given_char(']'); + let ip_addr = |p: &mut Parser| { + let ipv4_p = |p: &mut Parser| p.read_ip_addr(); + let ipv6_p = |p: &mut Parser| { + let open_br = |p: &mut Parser| p.read_given_char('['); + let ip_addr = |p: &mut Parser| p.read_ipv6_addr(); + let clos_br = |p: &mut Parser| p.read_given_char(']'); p.read_seq_3::<char, IpAddr, char, _, _, _>(open_br, ip_addr, clos_br) .map(|t| match t { (_, ip, _) => ip }) }; p.read_or(&mut [box ipv4_p, box ipv6_p]) }; - let colon = |&: p: &mut Parser| p.read_given_char(':'); - let port = |&: p: &mut Parser| p.read_number(10, 5, 0x10000).map(|n| n as u16); + let colon = |p: &mut Parser| p.read_given_char(':'); + let port = |p: &mut Parser| p.read_number(10, 5, 0x10000).map(|n| n as u16); // host, colon, port self.read_seq_3::<IpAddr, char, u16, _, _, _>(ip_addr, colon, port) diff --git a/src/libstd/old_io/process.rs b/src/libstd/old_io/process.rs index 27af957e18e..90395142494 100644 --- a/src/libstd/old_io/process.rs +++ b/src/libstd/old_io/process.rs @@ -703,7 +703,7 @@ impl Process { let (tx, rx) = channel(); match stream { Some(stream) => { - Thread::spawn(move |:| { + Thread::spawn(move || { let mut stream = stream; tx.send(stream.read_to_end()).unwrap(); }); diff --git a/src/libstd/rt/args.rs b/src/libstd/rt/args.rs index b3bed4af962..c2f5133eaf3 100644 --- a/src/libstd/rt/args.rs +++ b/src/libstd/rt/args.rs @@ -125,7 +125,7 @@ mod imp { assert!(take() == Some(expected.clone())); assert!(take() == None); - (|&mut:| { + (|| { }).finally(|| { // Restore the actual global state. match saved_value { diff --git a/src/libstd/sync/future.rs b/src/libstd/sync/future.rs index 8340652d19a..a230e35dac8 100644 --- a/src/libstd/sync/future.rs +++ b/src/libstd/sync/future.rs @@ -126,7 +126,7 @@ impl<A:Send> Future<A> { * waiting for the result to be received on the port. */ - Future::from_fn(move |:| { + Future::from_fn(move || { rx.recv().unwrap() }) } @@ -143,7 +143,7 @@ impl<A:Send> Future<A> { let (tx, rx) = channel(); - Thread::spawn(move |:| { + Thread::spawn(move || { // Don't panic if the other end has hung up let _ = tx.send(blk()); }); diff --git a/src/libstd/sync/task_pool.rs b/src/libstd/sync/task_pool.rs index 1bfcbcf96f1..684a46fd6ff 100644 --- a/src/libstd/sync/task_pool.rs +++ b/src/libstd/sync/task_pool.rs @@ -112,7 +112,7 @@ impl TaskPool { } fn spawn_in_pool(jobs: Arc<Mutex<Receiver<Thunk>>>) { - Thread::spawn(move |:| { + Thread::spawn(move || { // Will spawn a new thread on panic unless it is cancelled. let sentinel = Sentinel::new(&jobs); diff --git a/src/libstd/sys/common/helper_thread.rs b/src/libstd/sys/common/helper_thread.rs index 6f6179a436e..255f474d4f4 100644 --- a/src/libstd/sys/common/helper_thread.rs +++ b/src/libstd/sys/common/helper_thread.rs @@ -95,14 +95,14 @@ impl<M: Send> Helper<M> { let receive = RaceBox(receive); let t = f(); - Thread::spawn(move |:| { + Thread::spawn(move || { helper(receive.0, rx, t); let _g = self.lock.lock().unwrap(); *self.shutdown.get() = true; self.cond.notify_one() }); - rt::at_exit(move|:| { self.shutdown() }); + rt::at_exit(move|| { self.shutdown() }); *self.initialized.get() = true; } } diff --git a/src/libstd/sys/common/net.rs b/src/libstd/sys/common/net.rs index 833de8adda4..7325e0a5ac8 100644 --- a/src/libstd/sys/common/net.rs +++ b/src/libstd/sys/common/net.rs @@ -723,8 +723,8 @@ impl TcpStream { pub fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> { let fd = self.fd(); - let dolock = |&:| self.lock_nonblocking(); - let doread = |&mut: nb| unsafe { + let dolock = || self.lock_nonblocking(); + let doread = |nb| unsafe { let flags = if nb {c::MSG_DONTWAIT} else {0}; libc::recv(fd, buf.as_mut_ptr() as *mut libc::c_void, @@ -736,8 +736,8 @@ impl TcpStream { pub fn write(&mut self, buf: &[u8]) -> IoResult<()> { let fd = self.fd(); - let dolock = |&:| self.lock_nonblocking(); - let dowrite = |&: nb: bool, buf: *const u8, len: uint| unsafe { + let dolock = || self.lock_nonblocking(); + let dowrite = |nb: bool, buf: *const u8, len: uint| unsafe { let flags = if nb {c::MSG_DONTWAIT} else {0}; libc::send(fd, buf as *const _, @@ -871,7 +871,7 @@ impl UdpSocket { let mut addrlen: libc::socklen_t = mem::size_of::<libc::sockaddr_storage>() as libc::socklen_t; - let dolock = |&:| self.lock_nonblocking(); + let dolock = || self.lock_nonblocking(); let n = try!(read(fd, self.read_deadline, dolock, |nb| unsafe { let flags = if nb {c::MSG_DONTWAIT} else {0}; libc::recvfrom(fd, @@ -892,8 +892,8 @@ impl UdpSocket { let dstp = &storage as *const _ as *const libc::sockaddr; let fd = self.fd(); - let dolock = |&: | self.lock_nonblocking(); - let dowrite = |&mut: nb, buf: *const u8, len: uint| unsafe { + let dolock = || self.lock_nonblocking(); + let dowrite = |nb, buf: *const u8, len: uint| unsafe { let flags = if nb {c::MSG_DONTWAIT} else {0}; libc::sendto(fd, buf as *const libc::c_void, diff --git a/src/libstd/sys/unix/pipe.rs b/src/libstd/sys/unix/pipe.rs index 16274a2ab08..45d5b1506c3 100644 --- a/src/libstd/sys/unix/pipe.rs +++ b/src/libstd/sys/unix/pipe.rs @@ -151,8 +151,8 @@ impl UnixStream { pub fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> { let fd = self.fd(); - let dolock = |&:| self.lock_nonblocking(); - let doread = |&mut: nb| unsafe { + let dolock = || self.lock_nonblocking(); + let doread = |nb| unsafe { let flags = if nb {c::MSG_DONTWAIT} else {0}; libc::recv(fd, buf.as_mut_ptr() as *mut libc::c_void, @@ -164,8 +164,8 @@ impl UnixStream { pub fn write(&mut self, buf: &[u8]) -> IoResult<()> { let fd = self.fd(); - let dolock = |&: | self.lock_nonblocking(); - let dowrite = |&: nb: bool, buf: *const u8, len: uint| unsafe { + let dolock = || self.lock_nonblocking(); + let dowrite = |nb: bool, buf: *const u8, len: uint| unsafe { let flags = if nb {c::MSG_DONTWAIT} else {0}; libc::send(fd, buf as *const _, diff --git a/src/libstd/sys/unix/process.rs b/src/libstd/sys/unix/process.rs index 20f86227e8e..52a8ac9c338 100644 --- a/src/libstd/sys/unix/process.rs +++ b/src/libstd/sys/unix/process.rs @@ -84,8 +84,8 @@ impl Process { mem::transmute::<&ProcessConfig<K,V>,&'static ProcessConfig<K,V>>(cfg) }; - with_envp(cfg.env(), move|: envp: *const c_void| { - with_argv(cfg.program(), cfg.args(), move|: argv: *const *const libc::c_char| unsafe { + with_envp(cfg.env(), move|envp: *const c_void| { + with_argv(cfg.program(), cfg.args(), move|argv: *const *const libc::c_char| unsafe { let (input, mut output) = try!(sys::os::pipe()); // We may use this in the child, so perform allocations before the @@ -185,7 +185,7 @@ impl Process { // up /dev/null into that file descriptor. Otherwise, the first file // descriptor opened up in the child would be numbered as one of the // stdio file descriptors, which is likely to wreak havoc. - let setup = |&: src: Option<P>, dst: c_int| { + let setup = |src: Option<P>, dst: c_int| { let src = match src { None => { let flags = if dst == libc::STDIN_FILENO { diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs index 315c41e779a..839263f1f17 100644 --- a/src/libstd/sys/windows/process.rs +++ b/src/libstd/sys/windows/process.rs @@ -169,7 +169,7 @@ impl Process { // Similarly to unix, we don't actually leave holes for the stdio file // descriptors, but rather open up /dev/null equivalents. These // equivalents are drawn from libuv's windows process spawning. - let set_fd = |&: fd: &Option<P>, slot: &mut HANDLE, + let set_fd = |fd: &Option<P>, slot: &mut HANDLE, is_stdin: bool| { match *fd { None => { diff --git a/src/libstd/thread.rs b/src/libstd/thread.rs index c791ee2717b..52399ff771e 100644 --- a/src/libstd/thread.rs +++ b/src/libstd/thread.rs @@ -246,7 +246,7 @@ impl Builder { { let my_packet = Packet(Arc::new(UnsafeCell::new(None))); let their_packet = Packet(my_packet.0.clone()); - let (native, thread) = self.spawn_inner(Thunk::new(f), Thunk::with_arg(move |: ret| unsafe { + let (native, thread) = self.spawn_inner(Thunk::new(f), Thunk::with_arg(move |ret| unsafe { *their_packet.0.get() = Some(ret); })); @@ -273,7 +273,7 @@ impl Builder { // because by the time that this function is executing we've already // consumed at least a little bit of stack (we don't know the exact byte // address at which our stack started). - let main = move |:| { + let main = move || { let something_around_the_top_of_the_stack = 1; let addr = &something_around_the_top_of_the_stack as *const int; let my_stack_top = addr as uint; @@ -289,7 +289,7 @@ impl Builder { let mut output = None; let f: Thunk<(), T> = if stdout.is_some() || stderr.is_some() { - Thunk::new(move |:| { + Thunk::new(move || { let _ = stdout.map(stdio::set_stdout); let _ = stderr.map(stdio::set_stderr); f.invoke(()) diff --git a/src/libstd/thunk.rs b/src/libstd/thunk.rs index 2e53d0ceecb..0831242f954 100644 --- a/src/libstd/thunk.rs +++ b/src/libstd/thunk.rs @@ -24,7 +24,7 @@ impl<R> Thunk<(),R> { pub fn new<F>(func: F) -> Thunk<(),R> where F : FnOnce() -> R, F : Send { - Thunk::with_arg(move|: ()| func()) + Thunk::with_arg(move|()| func()) } } |
