Hello, great work on the rust book. However, I noted this and thought to mention it.
The example after Listing 20-12 in src/lib.rs should be:
#![allow(unused)]
pub struct ThreadPool;
fn main() {}
rather than
#![allow(unused)]
fn main() {
pub struct ThreadPool;
}
as described in the book
[UPDATE]
The example should actually be:
pub struct Thread pool;
without any main function, so I think this is more of disabling or removing the "show hidden lines" button on this example.
@tolumide-ng could you clarify where do you see the following snippet in the book?
fn main() {
pub struct ThreadPool;
}
I checked right after Listing 10-12 in https://doc.rust-lang.org/book/ch20-02-multithreaded.html#creating-a-similar-interface-for-a-finite-number-of-threads, and I don't see it.
If you click "show hidden lines", this appears. This is because of the way that rustdoc adds code to samples that don't have main in them.
got it, thanks @steveklabnik !
Hello, @novito would you be raising a fix for this?
hey @tolumide-ng - I would be happy to fork the repo and open a PR for this, but since you originally raised the issue, I invite you to do so. Check out the contributing guidelines.
@steveklabnik recently revised this 馃ズ
[UPDATE]
The example should actually be:
pub struct Thread pool;
without any main function on lib.rs, so I think this is more of disabling or removing the "show hidden lines" button on this specific example.
Most helpful comment
If you click "show hidden lines", this appears. This is because of the way that rustdoc adds code to samples that don't have main in them.