Skip to content

Small fixes to code samples in Tutorials #4669

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 4 commits into from
Jan 30, 2013

Conversation

pnkfelix
Copy link
Member

No description provided.

1. The section on trait definitions of static methods should include
   a trait with a static method in the generated document.

2. The section on trait inheritance had a expression that appears
   nonsensical ("let mycircle = @Mycircle") in the generated document.
   The text would be clearer (IMO) if we continued with the running
   example of CircleStruct.
1. In the first case, the previous code was failing during type inference
   due to mismatched structure.  Fix is to use the X structure at both
   points in the code.

2. In the second case, a naive transcription that subsitutes *nothing*
   in for the omitted statements signified by "..." will actually
   compile without an error.  Furthermore, any pure code could also be
   substituted for the ellipsis and the code would compile (as the
   text already states).  So to make the example more illustrative, it
   would be better to include an impure callback, which makes the
   potential for aliasing immediately obvious to the reader.
I had put a line break in to try to stress the binding of mycircle,
but generated document looks cleaner without newline.
@catamorphism
Copy link
Contributor

r+ -- @pnkfelix, do you have commit access to Rust, or do you want me to merge this for you for now?

@pnkfelix
Copy link
Member Author

@catamorphism I do not have commit access to Rust. Please push for me.

catamorphism added a commit that referenced this pull request Jan 30, 2013
Small fixes to code samples in Tutorials
@catamorphism catamorphism merged commit 3c02e2b into rust-lang:incoming Jan 30, 2013
@catamorphism
Copy link
Contributor

Merged, and thanks!

calebcartwright pushed a commit to calebcartwright/rust that referenced this pull request Oct 20, 2021
This option merges all imports into a single `use` statement as long as
they have the same visibility.
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