diff options
author | 2020-01-23 18:04:13 +0000 | |
---|---|---|
committer | 2020-01-23 10:04:13 -0800 | |
commit | ab028eb6a8e4ea858022b8767336b08e83a882c6 (patch) | |
tree | e05d7c8a2ea3cd64696beb48fdc6e68889eec491 /src/debug.rs | |
parent | e0eebde9938d03eb60fe97c4a41f464e4c83d414 (diff) | |
download | bytes-ab028eb6a8e4ea858022b8767336b08e83a882c6.tar.gz bytes-ab028eb6a8e4ea858022b8767336b08e83a882c6.tar.zst bytes-ab028eb6a8e4ea858022b8767336b08e83a882c6.zip |
rebuild_boxed_slice instead of rebuild_boxed_vec (#364)
"Promotable" `Bytes` object is constructed from disassembling a
boxed slice object, not a vec.
Thus we should reassemble data into a boxed slice, not into a vec.
Although, it does not create any problems in practice (`Box<[u8]>`
is allocated exactly the same way as `Vec<u8>`), technically it is
a violation of `Vec::from_raw_parts` spec which says that a pointer
"needs to have been previously allocated via `String`/`Vec<T>`".
Diffstat (limited to 'src/debug.rs')
0 files changed, 0 insertions, 0 deletions