Use handle the same way in similarly structured examples

This commit is contained in:
Kornel Lesiński 2015-08-20 21:50:20 +01:00
parent aca2057ed5
commit d112274fcb

View File

@ -343,12 +343,14 @@ threads as a simple isolation mechanism:
```rust
use std::thread;
let result = thread::spawn(move || {
let handle = thread::spawn(move || {
panic!("oops!");
}).join();
});
let result = handle.join();
assert!(result.is_err());
```
Our `Thread` gives us a `Result` back, which allows us to check if the thread
`Thread.join()` gives us a `Result` back, which allows us to check if the thread
has panicked or not.