From 3a2b3f4ffe04525d1ad73b0e3cf72fd877211c6d Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Sat, 11 Feb 2023 20:31:39 -0500 Subject: [PATCH] Address review comments --- citro3d/examples/triangle.rs | 7 +------ citro3d/src/render.rs | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/citro3d/examples/triangle.rs b/citro3d/examples/triangle.rs index f9c2522..50831e0 100644 --- a/citro3d/examples/triangle.rs +++ b/citro3d/examples/triangle.rs @@ -80,7 +80,7 @@ fn main() { let mut program = shader::Program::new(vertex_shader).unwrap(); let mut vbo_data = Vec::with_capacity_in(VERTICES.len(), ctru::linear::LinearAllocator); - vbo_data.extend(VERTICES); + vbo_data.extend_from_slice(VERTICES); let (uloc_projection, projection) = scene_init(&mut program, &vbo_data); @@ -106,11 +106,6 @@ fn main() { render_to(&mut top_target); render_to(&mut bottom_target); } - - // explicit drop to ensure the vbo_data lives long enough for the render code - // to reference it. This hopefully won't be necessary anymore if we can use - // lifetimes to manage the buffers instead of passing raw ptrs - drop(vbo_data); } fn scene_init(program: &mut shader::Program, vbo_data: &[Vertex]) -> (i8, C3D_Mtx) { diff --git a/citro3d/src/render.rs b/citro3d/src/render.rs index 425258e..0a7a563 100644 --- a/citro3d/src/render.rs +++ b/citro3d/src/render.rs @@ -41,7 +41,6 @@ impl<'screen> Target<'screen> { pub fn new( width: u16, height: u16, - // TODO: is there a use case for a render target that isn't associated with a Screen? screen: RefMut<'screen, dyn Screen>, depth_format: Option, ) -> Result {