From b72bf555559f8cdb20db4d39871bb4dcb53cf19e Mon Sep 17 00:00:00 2001 From: lazymio Date: Thu, 9 Mar 2023 02:12:09 +0100 Subject: [PATCH] Add From BytesInput trait for Vec (#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 --- libafl/src/inputs/bytes.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libafl/src/inputs/bytes.rs b/libafl/src/inputs/bytes.rs index 75cccd24be..1981923b7e 100644 --- a/libafl/src/inputs/bytes.rs +++ b/libafl/src/inputs/bytes.rs @@ -102,6 +102,12 @@ impl From<&[u8]> for BytesInput { } } +impl From for Vec { + fn from(value: BytesInput) -> Vec { + value.bytes + } +} + impl BytesInput { /// Creates a new bytes input using the given bytes #[must_use]