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

Add constructors for Bytes and ByteBuf #520

Merged
merged 2 commits into from Sep 5, 2016
Merged

Add constructors for Bytes and ByteBuf #520

merged 2 commits into from Sep 5, 2016

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Aug 23, 2016

This commit adds Bytes::new(&[u8]) and ByteBuf::from<T: Into<Vec<u8>>>(T).

Fixes #519.

This commit adds `Bytes::new(&[u8])` and `ByteBuf::from<T: Into<Vec<u8>>>(T)`.
@oli-obk
Copy link
Member

oli-obk commented Sep 5, 2016

The constructor methods should probably be used wherever the objects are currently created manually.

@dtolnay
Copy link
Member Author

dtolnay commented Sep 5, 2016

Done. I hope I got everything - I grepped for 'Bytes {' and 'ByteBuf {'.

@oli-obk
Copy link
Member

oli-obk commented Sep 5, 2016

Done. I hope I got everything - I grepped for 'Bytes {' and 'ByteBuf {'.

clippy should have a lint for that xD

@homu r+

homu added a commit that referenced this pull request Sep 5, 2016
Add constructors for Bytes and ByteBuf

This commit adds `Bytes::new(&[u8])` and `ByteBuf::from<T: Into<Vec<u8>>>(T)`.

Fixes #519.
@dtolnay
Copy link
Member Author

dtolnay commented Sep 5, 2016

Merging because it passes on 1.8/1.9/beta/stable but I opened the PR before v0.8.5 so nightly won't work.

@dtolnay dtolnay merged commit 8fe66c7 into master Sep 5, 2016
@dtolnay dtolnay deleted the bytes branch September 5, 2016 15:37
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.

None yet

3 participants