-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Add examples for VecDeque #34855
Add examples for VecDeque #34855
Conversation
Looks great, nice work! 👍 |
/// vector.push_back(1); | ||
/// vector.push_back(2); | ||
/// | ||
/// assert_eq!(vector.as_slices(), (&[0u32, 1, 2] as &[u32], &[] as &[u32])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is easier to read and more conventional:
assert_eq!(vector.as_slices(), (&[0, 1, 2][..], &[][..]));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option:
assert_eq!(vector.as_slices(), (&[0u32, 1, 2] as &[_], &[] as &[_]));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to be as explicit as possible. I don't see the point to use &[_]
instead of &[u32]
.
I think this is easier to read and more conventional:
assert_eq!(vector.as_slices(), (&[0, 1, 2][..], &[][..]));
I'm not really sure that it is simpler to read. :-/
@bors: r+ rollup |
📌 Commit 42326ec has been approved by |
⌛ Testing commit 42326ec with merge 81bb526... |
💔 Test failed - auto-win-msvc-64-opt-rustbuild |
@bors: retry On Tue, Jul 19, 2016 at 9:49 PM, bors notifications@github.com wrote:
|
⌛ Testing commit 42326ec with merge ce5b2d3... |
💔 Test failed - auto-linux-64-cargotest |
@bors: retry On Wed, Jul 20, 2016 at 6:11 PM, bors notifications@github.com wrote:
|
…veklabnik Add examples for VecDeque Part of rust-lang#29348. r? @steveklabnik
Part of #29348.
r? @steveklabnik