-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
slice: tweak concat & join #56463
slice: tweak concat & join #56463
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@bors r+ rollup |
📌 Commit ae53273 has been approved by |
slice: tweak concat & join - use `sum` instead of `fold` (readability) - adjust the capacity for `join` - the number of separators is `n - 1`, not `n`; proof: ``` fn main() { let a = [[1, 2], [4, 5]]; let v = a.join(&3); assert_ne!(v.len(), v.capacity()); // len is 5, capacity is 6 } ```
@bors ping |
💔 Test failed - status-travis |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
The error seems spurious. |
@bors retry |
slice: tweak concat & join - use `sum` instead of `fold` (readability) - adjust the capacity for `join` - the number of separators is `n - 1`, not `n`; proof: ``` fn main() { let a = [[1, 2], [4, 5]]; let v = a.join(&3); assert_ne!(v.len(), v.capacity()); // len is 5, capacity is 6 } ```
☀️ Test successful - status-appveyor, status-travis |
sum
instead offold
(readability)join
- the number of separators isn - 1
, notn
; proof: