tokio-rs / bytes

Utilities for working with bytes
MIT License
1.86k stars 278 forks source link

Resize refactor #696

Closed braddunbar closed 4 months ago

braddunbar commented 4 months ago

I've done a little refactoring of BytesMut:resize here to increase clarity, handle a few edge cases, and explicitly state soundness assumptions about unsafe code.

As I stated in my commits, this would be nicer with a let-else block, but that isn't currently covered by our MSRV.