authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-07-24 02:44:19 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-07-24 02:44:19 -07:00
logbff8af1f4360124f3dfcebaf7663d18bf7e91d07
tree47528b7e953a11f0086c79ad3f2617c51c587fb8
parentcab84e09ea974f75494df8278b468830d60a7878

cmd/fetch- alias `[]const u8` to `string`


1 files changed, 4 insertions(+), 3 deletions(-)

src/cmd/fetch.zig+4-3
...@@ -1,6 +1,7 @@...@@ -1,6 +1,7 @@
1const std = @import("std");1const std = @import("std");
2const gpa = std.heap.c_allocator;2const gpa = std.heap.c_allocator;
33
4const string = []const u8;
45
5const u = @import("./../util/index.zig");6const u = @import("./../util/index.zig");
6const common = @import("./../common.zig");7const common = @import("./../common.zig");
...@@ -33,7 +34,7 @@ pub fn execute(args: [][]u8) !void {...@@ -33,7 +34,7 @@ pub fn execute(args: [][]u8) !void {
33 try create_lockfile(list, dir);34 try create_lockfile(list, dir);
34}35}
3536
36pub fn create_depszig(dir: []const u8, top_module: u.Module, list: *std.ArrayList(u.Module)) !void {37pub fn create_depszig(dir: string, top_module: u.Module, list: *std.ArrayList(u.Module)) !void {
37 const f = try std.fs.cwd().createFile("deps.zig", .{});38 const f = try std.fs.cwd().createFile("deps.zig", .{});
38 defer f.close();39 defer f.close();
3940
...@@ -110,7 +111,7 @@ pub fn create_depszig(dir: []const u8, top_module: u.Module, list: *std.ArrayLis...@@ -110,7 +111,7 @@ pub fn create_depszig(dir: []const u8, top_module: u.Module, list: *std.ArrayLis
110 try w.writeAll("};\n\n");111 try w.writeAll("};\n\n");
111}112}
112113
113fn create_lockfile(list: *std.ArrayList(u.Module), dir: []const u8) !void {114fn create_lockfile(list: *std.ArrayList(u.Module), dir: string) !void {
114 const fl = try std.fs.cwd().createFile("zigmod.lock", .{});115 const fl = try std.fs.cwd().createFile("zigmod.lock", .{});
115 defer fl.close();116 defer fl.close();
116117
...@@ -254,7 +255,7 @@ fn print_pkgs(w: std.fs.File.Writer, m: u.Module) !void {...@@ -254,7 +255,7 @@ fn print_pkgs(w: std.fs.File.Writer, m: u.Module) !void {
254 try w.writeAll("}");255 try w.writeAll("}");
255}256}
256257
257fn print_imports(w: std.fs.File.Writer, m: u.Module, dir: []const u8) !void {258fn print_imports(w: std.fs.File.Writer, m: u.Module, dir: string) !void {
258 for (m.deps) |d| {259 for (m.deps) |d| {
259 if (d.main.len == 0) {260 if (d.main.len == 0) {
260 continue;261 continue;