std: unbox closures used in function arguments

This commit is contained in:
Jorge Aparicio
2014-12-30 18:05:17 -05:00
parent a17c2b60e1
commit 371f04d433
4 changed files with 7 additions and 5 deletions

View File

@@ -124,7 +124,9 @@ pub unsafe fn pipe() -> IoResult<(FileDesc, FileDesc)> {
}
}
pub fn fill_utf16_buf_and_decode(f: |*mut u16, DWORD| -> DWORD) -> Option<String> {
pub fn fill_utf16_buf_and_decode<F>(mut f: F) -> Option<String> where
F: FnMut(*mut u16, DWORD) -> DWORD,
{
unsafe {
let mut n = TMPBUF_SZ as DWORD;
let mut res = None;