Impl into_vec for Bytes#372
Conversation
Additionally rename ref_count in BytesMut's Shared data to ref_cnt to be inline with the Bytes impl.
|
Any updates on a possible merge of this? |
|
I'm sorry I missed this the first time! For this concept, my gut feeling is that adding |
|
Had I known you were planning on making the vtable public, I may have have taken another approach. What if the function consumes into a box slice? Data returned in that matter will be on the heap so returning a boxed slice would make sense. Either that or returning raw parts internally (which on a clone would require first assembling to a box slice and back into raw parts to return). What would be your preference? |
|
What do you mean by consuming into a boxed slice? What does that look like? |
|
Changing It's VTable specific, so I'm not sure how you're going to get around not having it required if you want the optimization. |
|
Friendly poke on this |
BytestoVec#151BytesMut::into_vecis not implemented. Currently you cannotconvert from a BytesMut to a Vec from a public interface (as like Bytes does) so I left this out for the time being.
100%on the atomic guarantees here.Side note, I've noticed there is a decent amount of repetition and other tid bits of work that can be done in this lib. Old comments referring to
Inneretc, no use ofcargo fmt. I'm happy to jam a decent amount of time into helping refactor, but I would first like to check no other work of this kind is being done offline so I'm not duplicating it. Would the maintainers be interested in PRs of this sort?