Tweak BufWrite::push

Make it pass the value, not a reference, to more closely match Vec's
behavior.  It's not a big difference because the type is `Copy`, but
still better.
This commit is contained in:
Raph Levien 2021-11-26 07:50:45 -08:00
parent f1d7560b3c
commit 97bc4c4471

View file

@ -26,8 +26,8 @@ impl BufWrite {
///
/// Panics if capacity is inadequate.
#[inline]
pub fn push(&mut self, item: &impl Pod) {
self.push_bytes(bytemuck::bytes_of(item));
pub fn push(&mut self, item: impl Pod) {
self.push_bytes(bytemuck::bytes_of(&item));
}
/// Extend with a slice of plain data objects.