Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>`".
- Loading branch information