Skip to content

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

Merged
merged 2 commits into from
Oct 3, 2013
Merged

Document std::opts. #9522

merged 2 commits into from
Oct 3, 2013

Conversation

steveklabnik
Copy link
Member

Added an overview with a 'real' example, as well as toy implementations of all of
the traits.

Closes #9356.

#[allow(missing_doc)];

/**
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! Nice catch, thanks.

@alexcrichton
Copy link
Member

This is awesome!

Is there a reason that the methods themselves were intentionally not documented?

@steveklabnik
Copy link
Member Author

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. ;)

@steveklabnik
Copy link
Member Author

@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!`.
*
* ```
Copy link
Member

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.)

@chris-morgan
Copy link
Member

I wonder whether it's worthwhile pointing out in the comment that all of these traits are included in the prelude and removing the use statements from the examples.

*
* # Example
*
* A trivial implementation of `Index`. When `Foo[idx]` happens, it ends up
Copy link
Member

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].

@steveklabnik
Copy link
Member Author

@chris-morgan updated to incorporate most of your feedback. One or more little questions to resolve still!

@steveklabnik
Copy link
Member Author

Trailing whitespace removed, spelling errors already fixed.

bors added a commit that referenced this pull request Oct 3, 2013
Added an overview with a 'real' example, as well as toy implementations of all of
the traits.

Closes #9356.
@bors bors closed this Oct 3, 2013
@bors bors merged commit 28e88b4 into rust-lang:master Oct 3, 2013
@steveklabnik
Copy link
Member Author

🤘

@steveklabnik steveklabnik deleted the doc_std_opts branch October 25, 2017 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document std::ops
6 participants