]> git.lizzy.rs Git - rust.git/commitdiff
std: unbox closures used in let bindings
authorJorge Aparicio <japaricious@gmail.com>
Wed, 31 Dec 2014 02:01:00 +0000 (21:01 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Thu, 1 Jan 2015 03:50:27 +0000 (22:50 -0500)
src/libstd/io/net/udp.rs
src/libstd/num/strconv.rs
src/libstd/sys/unix/process.rs
src/libstd/sys/windows/process.rs

index 1431067d4c6a3879eb19997f735cb0b645287817..73bcdad34c3a0433f9efd39ac2fe9975923f93e3 100644 (file)
@@ -344,7 +344,7 @@ fn stream_smoke_test_ip4() {
         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;
index b1f4e5acb93f4d28119c24f2974e59ed2a5dbb2f..25af3bf2d53835fca3b9c2f6378c49c5b201977d 100644 (file)
@@ -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
             };
 
index 835f4279d9bc69d3055eaf7431edc130e7c08f20..615e3a21bd0ac79c774f5392fd265f7728057a01 100644 (file)
@@ -195,7 +195,7 @@ fn fail(output: &mut FileDesc) -> ! {
                 // 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 {
index 0c2c76077dd5458595987f6b4c7736307110919e..b03c62395d1a081807296f0941aef38ec04d2ec7 100644 (file)
@@ -162,7 +162,7 @@ pub fn spawn<K, V, C, P>(cfg: &C, in_fd: Option<P>,
             // 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 => {