about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
authorJeff Olson <olson.jeffery@gmail.com>2013-07-19 16:22:13 -0700
committerJeff Olson <olson.jeffery@gmail.com>2013-07-22 13:19:04 -0700
commit155470fc9cd8e1cdfd0f6ecc558f865f54c1ef29 (patch)
tree7d7f70dd9afa98fa960007866079f5f2951f37ff /src/libstd/rt
parent5da29e3278b639540679e88fc7dd008435066e9a (diff)
downloadrust-155470fc9cd8e1cdfd0f6ecc558f865f54c1ef29.tar.gz
rust-155470fc9cd8e1cdfd0f6ecc558f865f54c1ef29.zip
std: minor timer cleanup based on feedback
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/io/mod.rs2
-rw-r--r--src/libstd/rt/io/timer.rs8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/rt/io/mod.rs b/src/libstd/rt/io/mod.rs
index e261b3a3c57..838c2d86c9f 100644
--- a/src/libstd/rt/io/mod.rs
+++ b/src/libstd/rt/io/mod.rs
@@ -298,7 +298,7 @@ mod extensions;
 mod support;
 
 /// Basic Timer
-mod timer;
+pub mod timer;
 
 /// Thread-blocking implementations
 pub mod native {
diff --git a/src/libstd/rt/io/timer.rs b/src/libstd/rt/io/timer.rs
index 1a5fc66f183..f80a91e988c 100644
--- a/src/libstd/rt/io/timer.rs
+++ b/src/libstd/rt/io/timer.rs
@@ -17,11 +17,11 @@ use rt::local::Local;
 pub struct Timer(~RtioTimerObject);
 
 impl Timer {
-    fn new(i: ~RtioTimerObject) -> Timer {
+    fn new_on_rt(i: ~RtioTimerObject) -> Timer {
         Timer(i)
     }
 
-    pub fn init() -> Option<Timer> {
+    pub fn new() -> Option<Timer> {
         let timer = unsafe {
             rtdebug!("Timer::init: borrowing io to init timer");
             let io = Local::unsafe_borrow::<IoFactoryObject>();
@@ -29,7 +29,7 @@ impl Timer {
             (*io).timer_init()
         };
         match timer {
-            Ok(t) => Some(Timer::new(t)),
+            Ok(t) => Some(Timer::new_on_rt(t)),
             Err(ioerr) => {
                 rtdebug!("Timer::init: failed to init: %?", ioerr);
                 io_error::cond.raise(ioerr);
@@ -53,7 +53,7 @@ mod test {
     #[test]
     fn test_io_timer_sleep_simple() {
         do run_in_newsched_task {
-            let timer = Timer::init();
+            let timer = Timer::new();
             match timer {
                 Some(t) => t.sleep(1),
                 None => assert!(false)