From 12dd7781d64f5898a435bb3d0210e0518285e128 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Tue, 30 Dec 2014 21:01:00 -0500 Subject: [PATCH] std: unbox closures used in let bindings --- src/libstd/io/net/udp.rs | 2 +- src/libstd/num/strconv.rs | 4 ++-- src/libstd/sys/unix/process.rs | 2 +- src/libstd/sys/windows/process.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libstd/io/net/udp.rs b/src/libstd/io/net/udp.rs index 1431067d4c6a..73bcdad34c3a 100644 --- a/src/libstd/io/net/udp.rs +++ b/src/libstd/io/net/udp.rs @@ -344,7 +344,7 @@ mod test { let (tx2, rx2) = channel(); spawn(move|| { - let send_as = |ip, val: &[u8]| { + let send_as = |&: ip, val: &[u8]| { match UdpSocket::bind(ip) { Ok(client) => { let client = box client; diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs index b1f4e5acb93f..25af3bf2d538 100644 --- a/src/libstd/num/strconv.rs +++ b/src/libstd/num/strconv.rs @@ -321,10 +321,10 @@ pub fn float_to_str_bytes_common( // 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/sys/unix/process.rs b/src/libstd/sys/unix/process.rs index 835f4279d9bc..615e3a21bd0a 100644 --- a/src/libstd/sys/unix/process.rs +++ b/src/libstd/sys/unix/process.rs @@ -195,7 +195,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

, dst: c_int| { + let setup = |&: src: Option

, 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 0c2c76077dd5..b03c62395d1a 100644 --- a/src/libstd/sys/windows/process.rs +++ b/src/libstd/sys/windows/process.rs @@ -162,7 +162,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

, slot: &mut HANDLE, + let set_fd = |&: fd: &Option

, slot: &mut HANDLE, is_stdin: bool| { match *fd { None => {