diff options
| author | Corey Farwell <coreyf@rwell.org> | 2014-11-28 11:57:41 -0500 |
|---|---|---|
| committer | Corey Farwell <coreyf@rwell.org> | 2014-12-05 18:13:04 -0500 |
| commit | 4ef16741e355754abd446acbd80e5afb784864c7 (patch) | |
| tree | bfe4f64de5b3bcf88672424d0f66b5ad12fe7054 /src/libstd/task.rs | |
| parent | 6f4c11be3b9706d1ba0e1b74b89de1478410a56f (diff) | |
| download | rust-4ef16741e355754abd446acbd80e5afb784864c7.tar.gz rust-4ef16741e355754abd446acbd80e5afb784864c7.zip | |
Utilize fewer reexports
In regards to: https://github.com/rust-lang/rust/issues/19253#issuecomment-64836729 This commit: * Changes the #deriving code so that it generates code that utilizes fewer reexports (in particur Option::* and Result::*), which is necessary to remove those reexports in the future * Changes other areas of the codebase so that fewer reexports are utilized
Diffstat (limited to 'src/libstd/task.rs')
| -rw-r--r-- | src/libstd/task.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/libstd/task.rs b/src/libstd/task.rs index a0ee08570d9..8b4dbf61c18 100644 --- a/src/libstd/task.rs +++ b/src/libstd/task.rs @@ -49,7 +49,8 @@ use boxed::Box; use comm::channel; use io::{Writer, stdio}; use kinds::{Send, marker}; -use option::{None, Some, Option}; +use option::Option; +use option::Option::{None, Some}; use result::Result; use rustrt::local::Local; use rustrt::task::Task; @@ -172,9 +173,10 @@ impl TaskBuilder { /// # Return value /// /// If the child task executes successfully (without panicking) then the - /// future returns `result::Ok` containing the value returned by the - /// function. If the child task panics then the future returns `result::Err` - /// containing the argument to `panic!(...)` as an `Any` trait object. + /// future returns `result::Result::Ok` containing the value returned by the + /// function. If the child task panics then the future returns + /// `result::Result::Err` containing the argument to `panic!(...)` as an + /// `Any` trait object. #[experimental = "Futures are experimental."] pub fn try_future<T:Send>(self, f: proc():Send -> T) -> Future<Result<T, Box<Any + Send>>> { @@ -268,7 +270,7 @@ mod test { use borrow::IntoCow; use boxed::BoxAny; use prelude::*; - use result::{Ok, Err}; + use result::Result::{Ok, Err}; use result; use std::io::{ChanReader, ChanWriter}; use string::String; @@ -330,7 +332,7 @@ mod test { match try(proc() { "Success!".to_string() }).as_ref().map(|s| s.as_slice()) { - result::Ok("Success!") => (), + result::Result::Ok("Success!") => (), _ => panic!() } } @@ -340,8 +342,8 @@ mod test { match try(proc() { panic!() }) { - result::Err(_) => (), - result::Ok(()) => panic!() + result::Result::Err(_) => (), + result::Result::Ok(()) => panic!() } } |
