Skip to content

Improve supertraits documentation #341

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 3 commits into from
May 26, 2018

Conversation

Havvy
Copy link
Contributor

@Havvy Havvy commented May 19, 2018

Some of it feels like it was from the guide. Should all be referency now. And also more cross linking.

@@ -10,7 +10,7 @@ interface consists of [associated items], which come in three varieties:
All traits define an implicit type parameter `Self` that refers to "the type
that is implementing this interface". Traits may also contain additional type
parameters. These type parameters (including `Self`) may be constrained by
other traits and so forth as usual.
other traits and so forth [as usual].
Copy link
Contributor

Choose a reason for hiding this comment

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

Purely a style nit so feel free to disagree: would it make sense to have [as usual][generics] so it's more clear to someone reading the source where pothole links are going?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably. I was thinking a similar thought when I was looking at it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm heading to work now, so I'll change it when I get home.

@alercah
Copy link
Contributor

alercah commented May 19, 2018

The number of examples still feels a bit guide-y to me? Perhaps consider collapsing them down into one or two examples.

@Havvy
Copy link
Contributor Author

Havvy commented May 19, 2018

I disagree. The examples each showcase a different facet of supertraits, not teach how they work. I did end up removing an example of a struct implementing both traits since it didn't showcase anything specific.

@Havvy
Copy link
Contributor Author

Havvy commented May 20, 2018

Made the "as usual" link easier to follow in markdown source, added a definition for subtract, and pared down the writing for one example.

@alercah alercah merged commit 4070c57 into rust-lang:master May 26, 2018
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.

2 participants