-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Document std::opts. #9522
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
Document std::opts. #9522
Conversation
#[allow(missing_doc)]; | ||
|
||
/** |
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 be /*!
, otherwise it will be attached to the Drop
trait.
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.
Ah! Nice catch, thanks.
This is awesome! Is there a reason that the methods themselves were intentionally not documented? |
I wrote it at 5am when I was a little hard up for sleep. By the time I wrote all those examples I was almost snoring. ;) |
@huonw I think I've addressed your feedback, thank you! |
Added an overview with a 'real' example, as well as toy implementations of all of the traits. Closes rust-lang#9356.
* A trivial implementation of `Sub`. When `Foo - Foo` happens, it ends up | ||
* calling `sub`, and therefore, `main` prints `Subtracting!`. | ||
* | ||
* ``` |
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.
I think you meant
```rust
(Also in a few other places lower down.)
I wonder whether it's worthwhile pointing out in the comment that all of these traits are included in the prelude and removing the |
* | ||
* # Example | ||
* | ||
* A trivial implementation of `Index`. When `Foo[idx]` happens, it ends up |
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.
That's actually Foo[Foo]
rather than Foo[idx]
.
@chris-morgan updated to incorporate most of your feedback. One or more little questions to resolve still! |
Trailing whitespace removed, spelling errors already fixed. |
Added an overview with a 'real' example, as well as toy implementations of all of the traits. Closes #9356.
🤘 |
Added an overview with a 'real' example, as well as toy implementations of all of
the traits.
Closes #9356.