diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-06-09 19:24:24 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-06-09 19:26:32 -0400 |
| commit | b735764898412c5b9388fdf729c8ad8db43ddde5 (patch) | |
| tree | 1a5873e654ff7189b236acc15516b9c6cd35a315 /std/fs.zig | |
| parent | 10e33b35368735d1911a073bcb7cbbaebee671ee (diff) | |
| download | zig-b735764898412c5b9388fdf729c8ad8db43ddde5.tar.gz zig-b735764898412c5b9388fdf729c8ad8db43ddde5.zip | |
different array literal syntax when inferring the size
old syntax: []i32{1, 2, 3}
new syntax: [_]i32{1, 2, 3}
closes #1797
Diffstat (limited to 'std/fs.zig')
| -rw-r--r-- | std/fs.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/std/fs.zig b/std/fs.zig index 6d5874d7c0..daad472958 100644 --- a/std/fs.zig +++ b/std/fs.zig @@ -209,7 +209,7 @@ pub fn makeDirW(dir_path: [*]const u16) !void { /// have been modified regardless. /// TODO determine if we can remove the allocator requirement from this function pub fn makePath(allocator: *Allocator, full_path: []const u8) !void { - const resolved_path = try path.resolve(allocator, [][]const u8{full_path}); + const resolved_path = try path.resolve(allocator, [_][]const u8{full_path}); defer allocator.free(resolved_path); var end_index: usize = resolved_path.len; @@ -447,13 +447,13 @@ pub const Dir = struct { .seek = 0, .index = 0, .end_index = 0, - .buf = []u8{}, + .buf = [_]u8{}, }, .linux => Handle{ .fd = try os.open(dir_path, os.O_RDONLY | os.O_DIRECTORY | os.O_CLOEXEC, 0), .index = 0, .end_index = 0, - .buf = []u8{}, + .buf = [_]u8{}, }, else => @compileError("unimplemented"), }, @@ -550,7 +550,7 @@ pub const Dir = struct { return null; } const name_utf16le = mem.toSlice(u16, self.handle.find_file_data.cFileName[0..].ptr); - if (mem.eql(u16, name_utf16le, []u16{'.'}) or mem.eql(u16, name_utf16le, []u16{ '.', '.' })) + if (mem.eql(u16, name_utf16le, [_]u16{'.'}) or mem.eql(u16, name_utf16le, [_]u16{ '.', '.' })) continue; // Trust that Windows gives us valid UTF-16LE const name_utf8_len = std.unicode.utf16leToUtf8(self.handle.name_data[0..], name_utf16le) catch unreachable; |
