Skip to content

Commit

Permalink
Moved .sleep() to Timer.
Browse files Browse the repository at this point in the history
  • Loading branch information
anasazi committed Aug 20, 2013
1 parent 063a005 commit a909144
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/libstd/rt/io/timer.rs
Expand Up @@ -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<Timer> {
let timer = unsafe {
Expand All @@ -30,18 +27,16 @@ 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);
None
}
}
}
}

impl RtioTimer for Timer {
fn sleep(&mut self, msecs: u64) {
pub fn sleep(&mut self, msecs: u64) {
(**self).sleep(msecs);
}
}
Expand Down

5 comments on commit a909144

@bors
Copy link
Contributor

@bors bors commented on a909144 Aug 23, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from brson
at anasazi@a909144

@bors
Copy link
Contributor

@bors bors commented on a909144 Aug 23, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging anasazi/rust/fix-timer-interface = a909144 into auto

@bors
Copy link
Contributor

@bors bors commented on a909144 Aug 23, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anasazi/rust/fix-timer-interface = a909144 merged ok, testing candidate = 4edf375

@bors
Copy link
Contributor

@bors bors commented on a909144 Aug 23, 2013

@bors
Copy link
Contributor

@bors bors commented on a909144 Aug 23, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 4edf375

Please sign in to comment.