std: unbox closures used in let bindings

This commit is contained in:
Jorge Aparicio 2014-12-30 21:01:00 -05:00
parent fb14dad4d6
commit 12dd7781d6
4 changed files with 5 additions and 5 deletions

View file

@ -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;

View 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
};

View file

@ -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<P>, dst: c_int| {
let setup = |&: src: Option<P>, dst: c_int| {
let src = match src {
None => {
let flags = if dst == libc::STDIN_FILENO {

View file

@ -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<P>, slot: &mut HANDLE,
let set_fd = |&: fd: &Option<P>, slot: &mut HANDLE,
is_stdin: bool| {
match *fd {
None => {