Skip to content

Resize refactor#696

Merged
braddunbar merged 8 commits intotokio-rs:masterfrom
braddunbar:resize-refactor
Apr 24, 2024
Merged

Resize refactor#696
braddunbar merged 8 commits intotokio-rs:masterfrom
braddunbar:resize-refactor

Conversation

@braddunbar
Copy link
Copy Markdown
Contributor

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.

We don't need to check capacity because it's already been reserved
above.
This would be better written with let-else, but we won't get that until
`MSRV >= 1.65.x`.
Co-authored-by: Alice Ryhl <aliceryhl@google.com>
@braddunbar braddunbar requested a review from Darksonn April 22, 2024 18:57
@braddunbar braddunbar merged commit 9d3ec1c into tokio-rs:master Apr 24, 2024
@braddunbar braddunbar deleted the resize-refactor branch April 24, 2024 09:49
@mox692 mox692 mentioned this pull request Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants