Skip to content

Commit

Permalink
impl Extend<&u8> for SharedBytesBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
TimLuq committed Jan 27, 2025
1 parent 145458e commit b98c535
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/shared_bytes_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,15 @@ impl core::iter::Extend<u8> for SharedBytesBuilder {
}
}

impl<'a> core::iter::Extend<&'a u8> for SharedBytesBuilder {
#[inline]
fn extend<I: IntoIterator<Item = &'a u8>>(&mut self, iter: I) {
for i in iter {
self.extend_from_slice(core::slice::from_ref(i));
}
}
}

impl<'a> core::iter::Extend<&'a [u8]> for SharedBytesBuilder {
#[inline]
fn extend<I: IntoIterator<Item = &'a [u8]>>(&mut self, iter: I) {
Expand Down

0 comments on commit b98c535

Please sign in to comment.