From 97bc4c4471498442608f59a06b18f7d07ee93dfc Mon Sep 17 00:00:00 2001 From: Raph Levien Date: Fri, 26 Nov 2021 07:50:45 -0800 Subject: [PATCH] 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. --- piet-gpu-hal/src/bufwrite.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/piet-gpu-hal/src/bufwrite.rs b/piet-gpu-hal/src/bufwrite.rs index 980b4b2..37f0292 100644 --- a/piet-gpu-hal/src/bufwrite.rs +++ b/piet-gpu-hal/src/bufwrite.rs @@ -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.