Skip to content

doc: Method examples for Result and Option #17339

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 5 commits into from
Sep 22, 2014
Merged

doc: Method examples for Result and Option #17339

merged 5 commits into from
Sep 22, 2014

Conversation

treeman
Copy link
Contributor

@treeman treeman commented Sep 17, 2014

Also some cleanup to conform to documentation style.

Remove ~~~ for code block specification. Use /// Over /** */ for doc
blocks.
@@ -270,6 +326,18 @@ impl<T> Option<T> {
/// In general, because this function may fail, its use is discouraged.
/// Instead, prefer to use pattern matching and handle the `None`
/// case explicitly.
///
/// # Examle
Copy link
Member

Choose a reason for hiding this comment

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

should be "Example" 😄

@steveklabnik
Copy link
Member

Thanks for this! one other comment: do we need the leading .s in the directives?

@treeman
Copy link
Contributor Author

treeman commented Sep 17, 2014

We do not actually need the .s. Is it preferred to use the shorter form? I see the {.rust} format in a lot of places.

@steveklabnik
Copy link
Member

Currently, I've been using {rust} everywhere, but we don't have an official style on this, and I'm actually not sure that it's worth being explicit.

Do you want to maybe collaborate on some kind of doc style guide RFC? /cc @aturon

@treeman
Copy link
Contributor Author

treeman commented Sep 17, 2014

I could collaborate on something like that yeah.

@treeman
Copy link
Contributor Author

treeman commented Sep 21, 2014

r?

bors added a commit that referenced this pull request Sep 22, 2014
Also some cleanup to conform to documentation style.
@bors bors closed this Sep 22, 2014
@bors bors merged commit a0d502b into rust-lang:master Sep 22, 2014
@treeman treeman deleted the doc-things branch September 22, 2014 11:26
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.

3 participants