by mutatio · 3y ago · 0 comments
The actual implementation requires having the `S` type to refer to, and the point of this post is to explain why the `S` type has to be named. By writing it as they did, the "// body omitted" one _could_ have had the same body, even without an 'S' type to refer to.
I bet the "// body omitted" bit of the post got refactored, and the reason for making the first one different from the stdlib impl got lost.
Here that's just a one-liner that works.
I need to check but I think that if you need to keep the same capacity, you may want to preallocate manually.
Good point. I have no clue either.
Maybe you can open an issue?