aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/util.rs b/src/util.rs
index 1a4e1c3..2b3580e 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -1,20 +1,5 @@
use core::libc::{c_int,c_uint};
-pub fn guard<T> (finally: ~fn (), body: &fn () -> T) -> T {
- let _guard = Guard { finally: finally };
- body()
-}
-
-struct Guard {
- priv finally: ~fn (),
-}
-
-impl Drop for Guard {
- fn finalize (&self) {
- (self.finally)();
- }
-}
-
// XXX huge hack until there's a better built-in way to do this
pub fn timed_read (timeout: int) -> Option<char> {
let first = unsafe { io_helper::timed_read(timeout as c_int) };