We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
BytesMut
Bytes
1 parent f3b363a commit 55dfea8Copy full SHA for 55dfea8
src/bytes.rs
@@ -926,6 +926,18 @@ impl FromIterator<u8> for Bytes {
926
}
927
928
929
+impl<'a> FromIterator<&'a u8> for BytesMut {
930
+ fn from_iter<T: IntoIterator<Item = &'a u8>>(into_iter: T) -> Self {
931
+ BytesMut::from_iter(into_iter.into_iter().map(|b| *b))
932
+ }
933
+}
934
+
935
+impl<'a> FromIterator<&'a u8> for Bytes {
936
937
+ BytesMut::from_iter(into_iter).freeze()
938
939
940
941
impl PartialEq for Bytes {
942
fn eq(&self, other: &Bytes) -> bool {
943
self.inner.as_ref() == other.inner.as_ref()
0 commit comments