mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
update std lib and compiler sources to new for loop syntax
This commit is contained in:
+1
-1
@@ -89,7 +89,7 @@ pub fn VectorCount(comptime VectorType: type) type {
|
||||
pub inline fn iota(comptime T: type, comptime len: usize) @Vector(len, T) {
|
||||
comptime {
|
||||
var out: [len]T = undefined;
|
||||
for (out) |*element, i| {
|
||||
for (&out, 0..) |*element, i| {
|
||||
element.* = switch (@typeInfo(T)) {
|
||||
.Int => @intCast(T, i),
|
||||
.Float => @intToFloat(T, i),
|
||||
|
||||
Reference in New Issue
Block a user