diff options
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/mpsc/mod.rs | 16 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/select.rs | 15 |
2 files changed, 19 insertions, 12 deletions
diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index 2e60d684d68..d783acd57ac 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -1024,14 +1024,14 @@ impl fmt::Display for TryRecvError { mod test { use prelude::v1::*; - use os; + use std::env; use super::*; use thread::Thread; pub fn stress_factor() -> uint { - match os::getenv("RUST_TEST_STRESS") { - Some(val) => val.parse().unwrap(), - None => 1, + match env::var("RUST_TEST_STRESS") { + Ok(val) => val.parse().unwrap(), + Err(..) => 1, } } @@ -1546,14 +1546,14 @@ mod test { mod sync_tests { use prelude::v1::*; - use os; + use std::env; use thread::Thread; use super::*; pub fn stress_factor() -> uint { - match os::getenv("RUST_TEST_STRESS") { - Some(val) => val.parse().unwrap(), - None => 1, + match env::var("RUST_TEST_STRESS") { + Ok(val) => val.parse().unwrap(), + Err(..) => 1, } } diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs index babae93b2d4..87b2fe8f100 100644 --- a/src/libstd/sync/mpsc/select.rs +++ b/src/libstd/sync/mpsc/select.rs @@ -111,11 +111,18 @@ pub trait Packet { } impl Select { - /// Creates a new selection structure. This set is initially empty and - /// `wait` will panic!() if called. + /// Creates a new selection structure. This set is initially empty. /// - /// Usage of this struct directly can sometimes be burdensome, and usage is - /// rather much easier through the `select!` macro. + /// Usage of this struct directly can sometimes be burdensome, and usage is much easier through + /// the `select!` macro. + /// + /// # Examples + /// + /// ``` + /// use std::sync::mpsc::Select; + /// + /// let select = Select::new(); + /// ``` pub fn new() -> Select { Select { head: ptr::null_mut(), |
