authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-29 15:12:13 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-29 15:12:13 -07:00
log82f021f019d8dcd7520521bb80e10d7988da27da
tree8d86bfec8eedce5fd003d2538d1d50d398708b2b
parentf242d848aef5798dc8349d22d2bae84aa6a8276d
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

use nio.fmt


8 files changed, 16 insertions(+), 7 deletions(-)

deps.zig+2
......@@ -338,6 +338,7 @@ pub const packages = [_]*Package{
338338 &package_data._o6ogpor87xc2,
339339 &package_data._f7dubzb7cyqe,
340340 &package_data._s84v9o48ucb0,
341 &package_data._kscsl0145t7x,
341342};
342343
343344pub const pkgs = struct {
......@@ -345,6 +346,7 @@ pub const pkgs = struct {
345346 pub const win32 = &package_data._o6ogpor87xc2;
346347 pub const extras = &package_data._f7dubzb7cyqe;
347348 pub const ansi = &package_data._s84v9o48ucb0;
349 pub const nio = &package_data._kscsl0145t7x;
348350};
349351
350352pub const imports = struct {
src/cmd/init.zig+2-1
......@@ -8,6 +8,7 @@ const knownfolders = @import("known-folders");
88const ini = @import("ini");
99const time = @import("time");
1010const extras = @import("extras");
11const nio = @import("nio");
1112
1213const u = @import("./../util/funcs.zig");
1314const common = @import("./../common.zig");
......@@ -85,7 +86,7 @@ pub fn execute(self_name: []const u8, args: [][:0]u8) !void {
8586 "year:",
8687 string,
8788 "{s}",
88 try std.fmt.allocPrint(gpa, "{d}", .{time.DateTime.now().years}),
89 try nio.fmt.allocPrint(gpa, "{d}", .{time.DateTime.now().years}),
8990 ));
9091 realtext = try std.mem.replaceOwned(u8, gpa, realtext, "<copyright holders>", try inquirer.forString(
9192 stdout,
src/cmd/install.zig+3-2
......@@ -3,6 +3,7 @@ const string = []const u8;
33const gpa = std.heap.c_allocator;
44const knownfolders = @import("known-folders");
55const extras = @import("extras");
6const nio = @import("nio");
67
78const zigmod = @import("./../lib.zig");
89const u = @import("./../util/funcs.zig");
......@@ -62,8 +63,8 @@ pub fn execute(self_name: []const u8, args: [][:0]u8) !void {
6263 try ci.do(gpa, cachepath, moddir);
6364
6465 const modfile = try zigmod.ModFile.from_dir(gpa, moddir, modpath);
65 const zigversion_sv = modfile.min_zig_version orelse u.fail("zigmod manifest requires min_zig_version field", .{});
66 const zigversion = try std.fmt.allocPrint(gpa, "{}", .{zigversion_sv});
66 _ = modfile.min_zig_version orelse u.fail("zigmod manifest requires min_zig_version field", .{});
67 const zigversion = try nio.fmt.allocPrint(gpa, "{s}", .{modfile.yaml.get_string("min_zig_version").?});
6768 const zigpath = try std.fs.path.join(gpa, &.{ datapath, "zig", zigversion, "zig" });
6869
6970 // zig build
src/common.zig+2-1
......@@ -3,6 +3,7 @@ const string = []const u8;
33const builtin = @import("builtin");
44const ansi = @import("ansi");
55const extras = @import("extras");
6const nio = @import("nio");
67
78const zigmod = @import("./lib.zig");
89const u = @import("./util/funcs.zig");
......@@ -302,7 +303,7 @@ pub fn gen_files_package(alloc: std.mem.Allocator, cachepath: string, mdir: std.
302303 continue;
303304 }
304305 const path = try alloc.dupe(u8, p.path);
305 try map.put(path, try std.fmt.allocPrint(alloc, "{s}/{s}", .{ dir_path, path }));
306 try map.put(path, try nio.fmt.allocPrint(alloc, "{s}/{s}", .{ dir_path, path }));
306307 }
307308 }
308309
src/main.zig+2-1
......@@ -4,6 +4,7 @@ const builtin = @import("builtin");
44pub const build_options = @import("build_options");
55const zigmod = @import("zigmod");
66const win32 = @import("win32");
7const nio = @import("nio");
78
89//
910//
......@@ -56,7 +57,7 @@ pub fn main() !void {
5657 }
5758
5859 var sub_cmd_args = std.ArrayList(string).init(gpa);
59 try sub_cmd_args.append(try std.fmt.allocPrint(gpa, "zigmod-{s}", .{args[0]}));
60 try sub_cmd_args.append(try nio.fmt.allocPrint(gpa, "zigmod-{s}", .{args[0]}));
6061 for (args[1..]) |item| {
6162 try sub_cmd_args.append(item);
6263 }
src/util/dep_type.zig+2-1
......@@ -1,5 +1,6 @@
11const std = @import("std");
22const string = []const u8;
3const nio = @import("nio");
34
45const u = @import("./funcs.zig");
56
......@@ -68,7 +69,7 @@ pub const DepType = enum {
6869 .local => "",
6970 .system_lib => "",
7071 .framework => "",
71 .git => try std.fmt.allocPrint(alloc, "commit-{s}", .{(try u.git_rev_HEAD(alloc, mdir))}),
72 .git => try nio.fmt.allocPrint(alloc, "commit-{s}", .{(try u.git_rev_HEAD(alloc, mdir))}),
7273 .hg => "",
7374 .http => "",
7475 };
src/util/module.zig+2-1
......@@ -3,6 +3,7 @@ const string = []const u8;
33const builtin = @import("builtin");
44const yaml = @import("yaml");
55const extras = @import("extras");
6const nio = @import("nio");
67
78const zigmod = @import("../lib.zig");
89const u = @import("funcs.zig");
......@@ -95,7 +96,7 @@ pub const Module = struct {
9596 }
9697 var out: [32]u8 = undefined;
9798 h.final(&out);
98 const hex = try std.fmt.allocPrint(alloc, "blake3-{x}", .{std.fmt.fmtSliceHexLower(out[0..])});
99 const hex = try nio.fmt.allocPrint(alloc, "blake3-{s}", .{&extras.to_hex(out)});
99100 return hex;
100101 }
101102
zig.mod+1
......@@ -35,3 +35,4 @@ root_dependencies:
3535 license: MIT
3636 - src: git https://github.com/nektro/zig-extras
3737 - src: git https://github.com/nektro/zig-ansi
38 - src: git https://github.com/nektro/zig-nio