Skip to content

Define a default method for `IntoBody`

Leonardo Schwarz requested to merge worr:feature/body-conversions into master

Created by: worr

Into<Vec<u8>> takes care of many of the cases where a user needs to convert an existing datatype to a sequence of bytes. If a user needs to write custom behavior, they now just need to implement Into<Vec<u8>>.

While this could be wholly supplanted by Into<Vec<u8>> and the IntoBody trait could be removed, it's part of the public API and should not be removed without a major version bump.

Merge request reports