-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[Doc] Improve thread::spawn
documentation
#41854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few small changes please! Thanks for this, looks great!
src/libstd/thread/mod.rs
Outdated
@@ -409,6 +411,54 @@ impl Builder { | |||
/// | |||
/// handler.join().unwrap(); | |||
/// ``` | |||
/// | |||
/// As mentionned in the module documentation, threads are usualy made to | |||
/// communicate using [`channel`s][`channels`], here is how it usually looks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should work without the second set of []
s by using the same text below
src/libstd/thread/mod.rs
Outdated
/// # Examples | ||
/// | ||
/// Simple thread creation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we say
Creating a thread:
instead here? I try to stick away from "simple" 😄
Done :) |
once this is fixed we should be good to go! |
Done :) |
src/libstd/thread/mod.rs
Outdated
@@ -409,6 +411,54 @@ impl Builder { | |||
/// | |||
/// handler.join().unwrap(); | |||
/// ``` | |||
/// | |||
/// As mentionned in the module documentation, threads are usualy made to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/mentionned/mentioned/
s/usualy/usually/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
@bors: r+ rollup |
📌 Commit fe7b6db has been approved by |
…labnik [Doc] Improve `thread::spawn` documentation Part of rust-lang#29378 - Add two examples to `thread::spawn` doumentation that show common uses of threads. - Add a link to `thread::Builder` in the `thread::spawn` documentation for configuring threads. - Add a link to `thread::spawn` in `thread::Builder` in order to avoid documentation duplication. r? @steveklabnik
Part of #29378
thread::spawn
doumentation that show common uses of threads.thread::Builder
in thethread::spawn
documentation for configuring threads.thread::spawn
inthread::Builder
in order to avoid documentation duplication.r? @steveklabnik