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

impl From<Box<[u8]>> for Bytes #504

Merged
merged 4 commits into from Aug 24, 2021
Merged

impl From<Box<[u8]>> for Bytes #504

merged 4 commits into from Aug 24, 2021

Conversation

ijackson
Copy link
Contributor

@ijackson ijackson commented Aug 4, 2021

Hi.

This missing impl was an inconvenience to me, and there seemed to be no reason for it not to exist.

The From<Vec<>> impl in fact turned the Vec into a Box almost immediately. I moved the check for empty slices into the new Box impl since it is needed there too, and added a test case.

I hope this meets with your approval and thanks for your attention.

This missing impl was an inconvenience to me, and there seemed to be
no reason for it not to exist.

The From<Vec<>> impl in fact turned the Vec into a Box almost
immediately.  I moved the check for empty slices into the new Box impl
since it is needed there too, and added a test case.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
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.

Thanks, this seems good to me.

@Darksonn Darksonn merged commit 0e9fa0b into tokio-rs:master Aug 24, 2021
@Darksonn Darksonn mentioned this pull request Aug 25, 2021
lelongg pushed a commit to lelongg/bytes that referenced this pull request Jan 9, 2023
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.

None yet

2 participants