librustuv: Change with_local_io to use RAII.

This commit is contained in:
Patrick Walton
2013-12-05 17:25:48 -08:00
parent 8c2ebe1622
commit 6bd80f7450
14 changed files with 186 additions and 157 deletions

View File

@@ -159,8 +159,11 @@ impl EventLoop for BasicLoop {
~BasicRemote::new(self.messages.clone(), id) as ~RemoteCallback
}
fn io<'a>(&'a mut self, f: |&'a mut IoFactory|) {
f(self.io)
fn io(&mut self) -> &'static mut IoFactory:'static {
unsafe {
let factory: &mut IoFactory = self.io;
cast::transmute(factory)
}
}
}