diff options
| author | bors <bors@rust-lang.org> | 2015-02-16 00:46:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-02-16 00:46:43 +0000 |
| commit | c5db290bf6df986a6acd5ce993f278c18e55ca37 (patch) | |
| tree | 5a67ed2bb3601bc1d5f477057324421fbd2291c3 /src/libstd/sync | |
| parent | 342ab53bf858a89e418973ba3bfff55161c0b174 (diff) | |
| parent | cea2bbfe27707becaacad1ce64b835b408c0ccf8 (diff) | |
| download | rust-c5db290bf6df986a6acd5ce993f278c18e55ca37.tar.gz rust-c5db290bf6df986a6acd5ce993f278c18e55ca37.zip | |
Auto merge of #22367 - Manishearth:rollup, r=steveklabnik
(still testing locally)
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(), |
