From 1b66995bddd059cd9a47d8849d54a4225904bee7 Mon Sep 17 00:00:00 2001 From: Matthew Gordon Date: Fri, 3 Apr 2020 23:34:44 -0400 Subject: [PATCH] Replace Vec references with slices in a few places. --- src/mesh.rs | 8 ++++---- src/raycasting/triangle.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mesh.rs b/src/mesh.rs index c1bd4f8..e3d486d 100644 --- a/src/mesh.rs +++ b/src/mesh.rs @@ -14,8 +14,8 @@ mod wavefront_obj { fn get_vertex_and_normal( index_tuple: &IndexTuple, - vertex_positions: &Vec<[f32; 3]>, - normal_positions: &Vec<[f32; 3]>, + vertex_positions: &[[f32; 3]], + normal_positions: &[[f32; 3]], ) -> (Point3, Vector3) where T: SupersetOf, @@ -31,8 +31,8 @@ mod wavefront_obj { fn get_triangles( polygon: &SimplePolygon, - vertex_positions: &Vec<[f32; 3]>, - normal_positions: &Vec<[f32; 3]>, + vertex_positions: &[[f32; 3]], + normal_positions: &[[f32; 3]], material: Arc>, ) -> Vec> where diff --git a/src/raycasting/triangle.rs b/src/raycasting/triangle.rs index dc76f50..cce5895 100644 --- a/src/raycasting/triangle.rs +++ b/src/raycasting/triangle.rs @@ -139,7 +139,7 @@ fn signed_edge_function(a: &Vector3, b: &Vector3) -> T { a.x * b.y - b.x * a.y } -fn signed_edge_functions(vertices: &Vec>) -> Vector3 { +fn signed_edge_functions(vertices: &[Vector3]) -> Vector3 { // Iterate over the inputs in such a way that each output element is calculated // from the twoother elements of the input. ( (y,z) -> x, (z,x) -> y, (x,y) -> z ) Vector3::from_iterator(