-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Confusing docs for core::ops::ControlFlow #133963
Copy link
Copy link
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 toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
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 toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Location
core::ops::ControlFlowand all its methods. Rust docs linkSummary
The docs for
core::ops::ControlFlow::is_break()look like:Firstly, the types switch across the two examples, which is unintuitive. The reader needs to spare the brain cells to identify which type represents
ContinueandBreakin each case (even though the variant being used is different), which could also distract them from noticing the!in the second statement. This would be much clearer if it looks like:The main change being that the types are consistent across the examples.
The same change would look good for the other methods on this enum.
I'm happy to submit a PR if someone greenlights this :)