From 39b6646e669a35d40e0da8e582b234226f024cae Mon Sep 17 00:00:00 2001 From: Thayne McCombs Date: Thu, 19 Dec 2019 12:09:14 -0700 Subject: [PATCH] Re-add impl From for Bytes (#348) --- src/bytes_mut.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bytes_mut.rs b/src/bytes_mut.rs index 7a1544434..8579f8c69 100644 --- a/src/bytes_mut.rs +++ b/src/bytes_mut.rs @@ -1020,6 +1020,12 @@ impl<'a> From<&'a str> for BytesMut { } } +impl From for Bytes { + fn from(src: BytesMut) -> Bytes { + src.freeze() + } +} + impl PartialEq for BytesMut { fn eq(&self, other: &BytesMut) -> bool { self.as_slice() == other.as_slice()