std: unbox closures used in function arguments
This commit is contained in:
parent
a17c2b60e1
commit
371f04d433
4 changed files with 7 additions and 5 deletions
|
|
@ -334,7 +334,7 @@ pub fn set_stderr(stderr: Box<Writer + Send>) -> Option<Box<Writer + Send>> {
|
|||
// // io1 aliases io2
|
||||
// })
|
||||
// })
|
||||
fn with_task_stdout(f: |&mut Writer| -> IoResult<()>) {
|
||||
fn with_task_stdout<F>(f: F) where F: FnOnce(&mut Writer) -> IoResult<()> {
|
||||
let mut my_stdout = LOCAL_STDOUT.with(|slot| {
|
||||
slot.borrow_mut().take()
|
||||
}).unwrap_or_else(|| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue