diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2014-12-07 14:15:25 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2014-12-13 17:03:47 -0500 |
| commit | cdbb3ca9b776b066e2c93acfb60da8537d2b1c9b (patch) | |
| tree | 18a305205c51df4501a5e5e73c4b275242fb5a25 /src/libstd/sys/windows/process.rs | |
| parent | be53d619f874cbe8e4d87f900060561d16405d53 (diff) | |
| download | rust-cdbb3ca9b776b066e2c93acfb60da8537d2b1c9b.tar.gz rust-cdbb3ca9b776b066e2c93acfb60da8537d2b1c9b.zip | |
libstd: use unboxed closures
Diffstat (limited to 'src/libstd/sys/windows/process.rs')
| -rw-r--r-- | src/libstd/sys/windows/process.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs index adbcff8a53f..356d6f02565 100644 --- a/src/libstd/sys/windows/process.rs +++ b/src/libstd/sys/windows/process.rs @@ -418,9 +418,8 @@ fn make_command_line(prog: &CString, args: &[CString]) -> String { } } -fn with_envp<K, V, T>(env: Option<&collections::HashMap<K, V>>, - cb: |*mut c_void| -> T) -> T - where K: BytesContainer + Eq + Hash, V: BytesContainer +fn with_envp<K, V, T, F>(env: Option<&collections::HashMap<K, V>>, cb: F) -> T where + K: BytesContainer + Eq + Hash, V: BytesContainer, F: FnOnce(*mut c_void) -> T, { // On Windows we pass an "environment block" which is not a char**, but // rather a concatenation of null-terminated k=v\0 sequences, with a final @@ -445,7 +444,9 @@ fn with_envp<K, V, T>(env: Option<&collections::HashMap<K, V>>, } } -fn with_dirp<T>(d: Option<&CString>, cb: |*const u16| -> T) -> T { +fn with_dirp<T, F>(d: Option<&CString>, cb: F) -> T where + F: FnOnce(*const u16) -> T, +{ match d { Some(dir) => { let dir_str = dir.as_str() |
