From f786ad490696882042e974449f846a3980d9263a Mon Sep 17 00:00:00 2001 From: Connor McMillin <22306123+Connor-McMillin@users.noreply.github.com> Date: Tue, 9 May 2023 10:25:50 -0700 Subject: [PATCH] Added Vec append to BufferVec - Issue #3531 (#8575) # Objective - Fixes #3531 ## Solution - Added an append wrapper to BufferVec based on the function signature for vec.append() --- First PR to Bevy. I didn't see any tests for other BufferVec methods (could have missed them) and currently this method is not used anywhere in the project. Let me know if there are tests to add or if I should find somewhere to use append so it is not dead code. The issue mentions implementing `truncate` and `extend` which were already implemented and merged [here](https://github.com/bevyengine/bevy/pull/6833/files#diff-c8fb332382379e383f1811e30c31991b1e0feb38ca436c357971755368012ced) --- crates/bevy_render/src/render_resource/buffer_vec.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/bevy_render/src/render_resource/buffer_vec.rs b/crates/bevy_render/src/render_resource/buffer_vec.rs index 4a3c744e07..07440a27e9 100644 --- a/crates/bevy_render/src/render_resource/buffer_vec.rs +++ b/crates/bevy_render/src/render_resource/buffer_vec.rs @@ -75,6 +75,10 @@ impl BufferVec { index } + pub fn append(&mut self, other: &mut BufferVec) { + self.values.append(&mut other.values); + } + pub fn set_label(&mut self, label: Option<&str>) { let label = label.map(str::to_string);