We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aca2057 commit d112274Copy full SHA for d112274
src/doc/trpl/concurrency.md
@@ -343,12 +343,14 @@ threads as a simple isolation mechanism:
343
```rust
344
use std::thread;
345
346
-let result = thread::spawn(move || {
+let handle = thread::spawn(move || {
347
panic!("oops!");
348
-}).join();
+});
349
+
350
+let result = handle.join();
351
352
assert!(result.is_err());
353
```
354
-Our `Thread` gives us a `Result` back, which allows us to check if the thread
355
+`Thread.join()` gives us a `Result` back, which allows us to check if the thread
356
has panicked or not.
0 commit comments