Skip to content

Instantly share code, notes, and snippets.

@killerswan
Created August 23, 2012 19:57
Show Gist options
  • Save killerswan/3440891 to your computer and use it in GitHub Desktop.
Save killerswan/3440891 to your computer and use it in GitHub Desktop.
an example && to replace
// fsync fd after executing blk
fn fd_res_sync(&&fd: FdRes, opt_level: option<Level>,
blk: fn(&&Res<fd_t>)) {
blk(Res({
val: fd.fd, opt_level: opt_level,
fsync_fn: fn@(&&fd: fd_t, l: Level) -> int {
return os::fsync_fd(fd, l) as int;
}
}));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment