bytes icon indicating copy to clipboard operation
bytes copied to clipboard

[Question] Is it reasonable to have cost efficient constructor for BytesMut?

Open ileixe opened this issue 2 years ago • 0 comments

Currently, BytesMut seems to require buffer allocation when converted from other types: https://docs.rs/bytes/latest/src/bytes/bytes_mut.rs.html#1172

Is there any reason not to provide allocation-free BytesMut constructor like https://docs.rs/bytes/latest/src/bytes/bytes.rs.html#843? (I'd like to use Box<[u8]> to create BytesMut as well. )

ileixe avatar Feb 01 '23 02:02 ileixe