Skip to content

Commit a909144

Browse files
committed
Moved .sleep() to Timer.
1 parent 063a005 commit a909144

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/libstd/rt/io/timer.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ use rt::local::Local;
1818
pub struct Timer(~RtioTimerObject);
1919

2020
impl Timer {
21-
fn new_on_rt(i: ~RtioTimerObject) -> Timer {
22-
Timer(i)
23-
}
2421

2522
pub fn new() -> Option<Timer> {
2623
let timer = unsafe {
@@ -30,18 +27,16 @@ impl Timer {
3027
(*io).timer_init()
3128
};
3229
match timer {
33-
Ok(t) => Some(Timer::new_on_rt(t)),
30+
Ok(t) => Some(Timer(t)),
3431
Err(ioerr) => {
3532
rtdebug!("Timer::init: failed to init: %?", ioerr);
3633
io_error::cond.raise(ioerr);
3734
None
3835
}
3936
}
4037
}
41-
}
4238

43-
impl RtioTimer for Timer {
44-
fn sleep(&mut self, msecs: u64) {
39+
pub fn sleep(&mut self, msecs: u64) {
4540
(**self).sleep(msecs);
4641
}
4742
}

0 commit comments

Comments
 (0)