aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-04-03 02:45:53 -0500
committerJesse Luehrs <doy@tozt.net>2013-04-03 02:46:18 -0500
commit0465ddb62b7708819a668aced5ade29cde6a8be0 (patch)
tree86ef870df906b279ed9e4c63ee5a7ee1b41b3bd7 /src/util.rs
parent3e95a135f67b52589957c14595ad3837c7f2f1e5 (diff)
downloadrust-term-0465ddb62b7708819a668aced5ade29cde6a8be0.tar.gz
rust-term-0465ddb62b7708819a668aced5ade29cde6a8be0.zip
split this out into a separate module too
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) };