diff options
| author | Aaron Turon <aturon@mozilla.com> | 2014-12-06 18:34:37 -0800 |
|---|---|---|
| committer | Aaron Turon <aturon@mozilla.com> | 2014-12-18 23:31:51 -0800 |
| commit | 43ae4b3301cc0605839778ecf59effb32b752e33 (patch) | |
| tree | aa111f5adc1eaa1e996847e1437d1b1b40821ce0 /src/doc/guide-tasks.md | |
| parent | 14c1a103bc3f78721df1dc860a75a477c8275e3a (diff) | |
| download | rust-43ae4b3301cc0605839778ecf59effb32b752e33.tar.gz rust-43ae4b3301cc0605839778ecf59effb32b752e33.zip | |
Fallout from new thread API
Diffstat (limited to 'src/doc/guide-tasks.md')
| -rw-r--r-- | src/doc/guide-tasks.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/doc/guide-tasks.md b/src/doc/guide-tasks.md index 4adca43be18..4753ba7fe47 100644 --- a/src/doc/guide-tasks.md +++ b/src/doc/guide-tasks.md @@ -347,16 +347,16 @@ result with an `int` field (representing a successful result) or an `Err` result (representing termination with an error). ```{rust} -# use std::task; +# use std::thread::Thread; # fn some_condition() -> bool { false } # fn calculate_result() -> int { 0 } -let result: Result<int, Box<std::any::Any + Send>> = task::try(move || { +let result: Result<int, Box<std::any::Any + Send>> = Thread::with_join(move || { if some_condition() { calculate_result() } else { panic!("oops!"); } -}); +}).join(); assert!(result.is_err()); ``` |
