Add From BytesInput trait for Vec<u8> (#1135)
* Allow take the ownership of the BytesInput * Add must_use as told * Implement From&Into for better interoperability * Format code * Remove into_bytes * Remove From<&BytesInput> to avoid misuse
This commit is contained in:
parent
4d778dd64d
commit
b72bf55555
@ -102,6 +102,12 @@ impl From<&[u8]> for BytesInput {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<BytesInput> for Vec<u8> {
|
||||||
|
fn from(value: BytesInput) -> Vec<u8> {
|
||||||
|
value.bytes
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl BytesInput {
|
impl BytesInput {
|
||||||
/// Creates a new bytes input using the given bytes
|
/// Creates a new bytes input using the given bytes
|
||||||
#[must_use]
|
#[must_use]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user