Skip to content

Commit 12dd778

Browse files
author
Jorge Aparicio
committed
std: unbox closures used in let bindings
1 parent fb14dad commit 12dd778

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/libstd/io/net/udp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ mod test {
344344
let (tx2, rx2) = channel();
345345

346346
spawn(move|| {
347-
let send_as = |ip, val: &[u8]| {
347+
let send_as = |&: ip, val: &[u8]| {
348348
match UdpSocket::bind(ip) {
349349
Ok(client) => {
350350
let client = box client;

src/libstd/num/strconv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,10 @@ pub fn float_to_str_bytes_common<T: Float>(
321321
// cut off the one extra digit, and depending on its value
322322
// round the remaining ones.
323323
if limit_digits && dig == digit_count {
324-
let ascii2value = |chr: u8| {
324+
let ascii2value = |&: chr: u8| {
325325
(chr as char).to_digit(radix).unwrap()
326326
};
327-
let value2ascii = |val: uint| {
327+
let value2ascii = |&: val: uint| {
328328
char::from_digit(val, radix).unwrap() as u8
329329
};
330330

src/libstd/sys/unix/process.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl Process {
195195
// up /dev/null into that file descriptor. Otherwise, the first file
196196
// descriptor opened up in the child would be numbered as one of the
197197
// stdio file descriptors, which is likely to wreak havoc.
198-
let setup = |src: Option<P>, dst: c_int| {
198+
let setup = |&: src: Option<P>, dst: c_int| {
199199
let src = match src {
200200
None => {
201201
let flags = if dst == libc::STDIN_FILENO {

src/libstd/sys/windows/process.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl Process {
162162
// Similarly to unix, we don't actually leave holes for the stdio file
163163
// descriptors, but rather open up /dev/null equivalents. These
164164
// equivalents are drawn from libuv's windows process spawning.
165-
let set_fd = |fd: &Option<P>, slot: &mut HANDLE,
165+
let set_fd = |&: fd: &Option<P>, slot: &mut HANDLE,
166166
is_stdin: bool| {
167167
match *fd {
168168
None => {

0 commit comments

Comments
 (0)