@@ -458,20 +458,22 @@ test "zmesh.invert" {
458458test "zmesh.custom" {
459459 const zmesh = @import ("root.zig" );
460460
461- zmesh .init (std .testing .allocator );
461+ const allocator = std .testing .allocator ;
462+
463+ zmesh .init (allocator );
462464 defer zmesh .deinit ();
463465
464- var positions = std .ArrayList ([3 ]f32 ). init ( std . testing . allocator ) ;
465- defer positions .deinit ();
466- try positions .append (.{ 0.0 , 0.0 , 0.0 });
467- try positions .append (.{ 1.0 , 0.0 , 0.0 });
468- try positions .append (.{ 1.0 , 0.0 , 1.0 });
469-
470- var indices = std .ArrayList (IndexType ). init ( std . testing . allocator ) ;
471- defer indices .deinit ();
472- try indices .append (0 );
473- try indices .append (1 );
474- try indices .append (2 );
466+ var positions : std .ArrayList ([3 ]f32 ) = .{} ;
467+ defer positions .deinit (allocator );
468+ try positions .append (allocator , .{ 0.0 , 0.0 , 0.0 });
469+ try positions .append (allocator , .{ 1.0 , 0.0 , 0.0 });
470+ try positions .append (allocator , .{ 1.0 , 0.0 , 1.0 });
471+
472+ var indices : std .ArrayList (IndexType ) = .{} ;
473+ defer indices .deinit (allocator );
474+ try indices .append (allocator , 0 );
475+ try indices .append (allocator , 1 );
476+ try indices .append (allocator , 2 );
475477
476478 var shape = Shape .init (indices , positions , null , null );
477479 defer shape .deinit ();
0 commit comments