Skip to content

Conversation

@paolobarbolini
Copy link
Contributor

Incorporates the improvement from #698 into the must_use suggestion of BytesMut::split.

Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know, this makes me realize that advance could be simplified to call clear instead of set_len(0).

@Darksonn Darksonn merged commit a8806c2 into tokio-rs:master Apr 25, 2024
@paolobarbolini
Copy link
Contributor Author

paolobarbolini commented Apr 25, 2024

You know, this makes me realize that advance could be simplified to call clear instead of set_len(0).

Yeah I had skipped clear because it can't avoid the branch inside truncate, but I guess if that was a real problem it could be solved within clear itself.

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