-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Remove SliceConcatExt, add them as methods on [T]. #1141
Comments
Related PR: Rename connect to join. BTW I'd very much like |
Moving a method from an unstable trait to an inherent impl is a minor breaking change I guess. This quirky stuff compiles because concat is on a prelude trait: <_>::concat(&["1", "2"][..]) |
Here's how Servo joins strings. It's nice that it works directly with iterators to avoid unnecessary allocations |
@frewsxcv |
Right, the slice version avoids reallocation while building the string by iterating through to sum up the exact capacity needed up front. |
I meant that if I have some other data structure like a |
Yes. Notice that servo could use SliceConcatExt's join when it has a slice for a much more efficient |
Remove SliceConcatExt, add them as methods on [T].
We don't need extension traits for this anymore.
The text was updated successfully, but these errors were encountered: