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

Implement From for ByteArray, ByteBuf and Bytes #51

Merged
merged 3 commits into from
Jun 25, 2024

Conversation

zensh
Copy link
Contributor

@zensh zensh commented Jun 14, 2024

Implement From for ByteArray, ByteBuf and Bytes.
Implement Default for ByteArray.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Thanks!

src/bytebuf.rs Outdated
Comment on lines 134 to 136
impl<T> From<T> for ByteBuf
where
T: Into<Vec<u8>>,
Copy link
Member

Choose a reason for hiding this comment

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

This impl looks too general to me. For example, this would block us from adding impl From<ByteBuf> for Vec<u8>.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed. I made some adjustments.

@zensh
Copy link
Contributor Author

zensh commented Jun 18, 2024

Hey, @dtolnay, any other suggestions?

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Looks good!

@dtolnay dtolnay merged commit dde7c9e into serde-rs:master Jun 25, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants