@@ -152,7 +152,7 @@ impl BoundingBox {
152152 }
153153 }
154154
155- pub fn every_voxel_address < ' a > ( & ' a self ) -> impl Iterator < Item = VoxelAddress > + ' a {
155+ pub fn every_voxel_address ( & self ) -> impl Iterator < Item = VoxelAddress > + ' _ {
156156 self . bounding_boxes . iter ( ) . flat_map ( |cbb| {
157157 cbb. every_voxel ( ) . map ( move |index| VoxelAddress {
158158 node : cbb. node ,
@@ -242,7 +242,7 @@ impl ChunkBoundingBox {
242242 }
243243 }
244244
245- pub fn every_voxel < ' b > ( & ' b self ) -> impl Iterator < Item = u32 > + ' b {
245+ pub fn every_voxel ( & self ) -> impl Iterator < Item = u32 > + ' _ {
246246 let lwm = ( self . dimension as u32 ) + 2 ;
247247 ( self . min_xyz [ 2 ] ..self . max_xyz [ 2 ] ) . flat_map ( move |z| {
248248 ( self . min_xyz [ 1 ] ..self . max_xyz [ 1 ] ) . flat_map ( move |y| {
@@ -260,9 +260,11 @@ lazy_static! {
260260 static ref PERPENDICULAR_VERTEX : [ [ Option <Vertex >; VERTEX_COUNT ] ; SIDE_COUNT ] = {
261261 let mut result = [ [ None ; VERTEX_COUNT ] ; SIDE_COUNT ] ;
262262
263- for s in 0 ..SIDE_COUNT {
264- let side = Side :: from_index( s) ;
263+ for side in Side :: iter( ) {
265264 let incident_vertices = side. vertices( ) ;
265+
266+ // 'v' and 'vertex as usize' will have different values.
267+ #[ allow( clippy:: needless_range_loop) ]
266268 for v in 0 ..5 {
267269 let vertex = incident_vertices[ v] ;
268270 let mut vertex_counts = [ 0 ; VERTEX_COUNT ] ;
@@ -280,9 +282,9 @@ lazy_static! {
280282 // inceident corners as not perpendicular
281283 for i in side. vertices( ) . iter( ) { vertex_counts[ * i as usize ] = -1 }
282284
283- for i in 0 .. VERTEX_COUNT {
284- if vertex_counts[ i] == 2 {
285- result[ s ] [ vertex as usize ] = Some ( Vertex :: from_index ( i ) ) ;
285+ for i in Vertex :: iter ( ) {
286+ if vertex_counts[ i as usize ] == 2 {
287+ result[ side as usize ] [ vertex as usize ] = Some ( i ) ;
286288 break ;
287289 }
288290 }
@@ -295,10 +297,7 @@ lazy_static! {
295297#[ cfg( test) ]
296298mod tests {
297299 use super :: * ;
298- use crate :: node:: { DualGraph , Node } ;
299- use crate :: Chunks ;
300300 use crate :: { graph:: Graph , proto:: Position , traversal:: ensure_nearby} ;
301- use approx:: * ;
302301
303302 const CHUNK_SIZE : u8 = 12_u8 ; // might want to test with multiple values in the future.
304303 static CHUNK_SIZE_F : f64 = CHUNK_SIZE as f64 ;
@@ -460,7 +459,7 @@ mod tests {
460459 BoundingBox :: create_aabb ( NodeId :: ROOT , position, radius, & graph, CHUNK_SIZE ) ;
461460
462461 let mut actual_voxels = 0 ;
463- for address in bb. every_voxel_address ( ) {
462+ for _address in bb. every_voxel_address ( ) {
464463 actual_voxels += 1 ;
465464 }
466465
0 commit comments