-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Description
I happened to stumble across this documentation earlier, and was surprised by the style of the following example of code that should panic:
use std::thread;
let result = thread::spawn(|| {
// this panics
'1'.is_digit(37);
}).join();
assert!(result.is_err());
In particular, this does not seem to use the should_panic
attribute that is used in other places in the documentation (eg Option
's unwrap ). As a result, it seems unnecessarily hard to read especially since this is a method which is likely to be of interest even for very new users. I was going to open a PR fixing this, but first wanted to ask if there is any particular reason for or benefit from this style? It also appears in a number of other places in the documentation for char
- I have not yet searched elsewhere.
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.