When using current unsplit
, it's not immediately obvious to a pub user that the operation will soft-fail if the owning BytesMut
reallocates because of insufficient capacity. In hindsight this is obvious, but this method gives off the impression that Bytes simply need to be contiguous. Emphasis on both contiguous and from the same allocation with a note in the doc that a reallocation will invalidate formerly contiguous blocks.
try_unsplit
only has one fail case that's side-effect free. It doesn't pose a danger to public users. Why not make it pub?