Sliceext examples#21625
Merged
bors merged 2 commits intorust-lang:masterfrom Jan 28, 2015
carols10cents:sliceext-examples
Merged
Sliceext examples#21625bors merged 2 commits intorust-lang:masterfrom carols10cents:sliceext-examples
bors merged 2 commits intorust-lang:masterfrom
carols10cents:sliceext-examples
Conversation
Contributor
|
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
Member
Author
|
Also, I tried running |
Member
Author
|
|
Member
Author
|
Yay that worked! Let me know if I should do anything else :) |
src/libcollections/slice.rs
Outdated
Contributor
There was a problem hiding this comment.
I think these should be assert_eq
Member
Author
|
All fixed! Thank you for the feedback-- I changed to |
Member
|
@bors: r+ edb2d8d rollup thanks! |
Collaborator
|
🙀 You have the wrong number! Please try again with |
Member
barosl
added a commit
to barosl/rust
that referenced
this pull request
Jan 27, 2015
…alexcrichton Hi! I added some examples to some stable SliceExt methods that didn't have any. I'm looking forward to feedback and I'm happy to change anything-- it looks like the doc conventions are still a bit in flux, based on the discussions going on in [rfc 505](rust-lang/rfcs#505). I was most unsure about examples for methods that return iterators over slices... I wanted to use asserts on the result of calling `.next()` like in [this permutations example](https://github.com/carols10cents/rust/blob/804c1446b3b0afd84851339d8ee2be1dca8f7713/src/libcollections/slice.rs#L608-L617), but then it gets all cluttered up with lifetime stuff... so I went with iterating and printing and mentioning what the expected printed output is like in [this chunks example](https://github.com/carols10cents/rust/blob/804c1446b3b0afd84851339d8ee2be1dca8f7713/src/libcollections/slice.rs#L297-L304)... any ideas for the best ways to do this are appreciated. Thank you! ❤️
Manishearth
added a commit
to Manishearth/rust
that referenced
this pull request
Jan 27, 2015
…alexcrichton Hi! I added some examples to some SliceExt methods that didn't have any. I'm looking forward to feedback and I'm happy to change anything-- it looks like the doc conventions are still a bit in flux, based on the discussions going on in [rfc 505](rust-lang/rfcs#505). I was most unsure about examples for methods that return iterators over slices... I wanted to use asserts on the result of calling `.next()` like in [this permutations example](https://github.com/carols10cents/rust/blob/804c1446b3b0afd84851339d8ee2be1dca8f7713/src/libcollections/slice.rs#L608-L617), but then it gets all cluttered up with lifetime stuff... so I went with iterating and printing and mentioning what the expected printed output is like in [this chunks example](https://github.com/carols10cents/rust/blob/804c1446b3b0afd84851339d8ee2be1dca8f7713/src/libcollections/slice.rs#L297-L304)... any ideas for the best ways to do this are appreciated. Thank you! ❤️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi! I added some examples to some stable SliceExt methods that didn't have any.
I'm looking forward to feedback and I'm happy to change anything-- it looks like the doc conventions are still a bit in flux, based on the discussions going on in rfc 505.
I was most unsure about examples for methods that return iterators over slices... I wanted to use asserts on the result of calling
.next()like in this permutations example, but then it gets all cluttered up with lifetime stuff... so I went with iterating and printing and mentioning what the expected printed output is like in this chunks example... any ideas for the best ways to do this are appreciated.Thank you! ❤️