Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resize refactor #696

Merged
merged 8 commits into from
Apr 24, 2024
Merged

Resize refactor #696

merged 8 commits into from
Apr 24, 2024

Conversation

braddunbar
Copy link
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`.
src/bytes_mut.rs Outdated Show resolved Hide resolved
@braddunbar braddunbar requested a review from Darksonn April 22, 2024 18:57
@braddunbar braddunbar merged commit 9d3ec1c into tokio-rs:master Apr 24, 2024
15 checks passed
@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