From a909144b1c5cc5ae5d32aaba63a4ee6bce5fc1e2 Mon Sep 17 00:00:00 2001 From: Eric Reed Date: Tue, 20 Aug 2013 09:53:02 -0700 Subject: [PATCH] Moved .sleep() to Timer. --- src/libstd/rt/io/timer.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/libstd/rt/io/timer.rs b/src/libstd/rt/io/timer.rs index bfd1ed48ac180..b0ec747800d23 100644 --- a/src/libstd/rt/io/timer.rs +++ b/src/libstd/rt/io/timer.rs @@ -18,9 +18,6 @@ use rt::local::Local; pub struct Timer(~RtioTimerObject); impl Timer { - fn new_on_rt(i: ~RtioTimerObject) -> Timer { - Timer(i) - } pub fn new() -> Option { let timer = unsafe { @@ -30,7 +27,7 @@ impl Timer { (*io).timer_init() }; match timer { - Ok(t) => Some(Timer::new_on_rt(t)), + Ok(t) => Some(Timer(t)), Err(ioerr) => { rtdebug!("Timer::init: failed to init: %?", ioerr); io_error::cond.raise(ioerr); @@ -38,10 +35,8 @@ impl Timer { } } } -} -impl RtioTimer for Timer { - fn sleep(&mut self, msecs: u64) { + pub fn sleep(&mut self, msecs: u64) { (**self).sleep(msecs); } }