Skip to content

Commit

Permalink
use sig.utils.fmt.boundedFmt instead of std.fmt.allocPrint
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicfromnewyoke committed Sep 30, 2024
1 parent ca41854 commit 6c83b66
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/gossip/dump_service.zig
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ pub const GossipDumpService = struct {

pub fn run(self: Self) !void {
const start_time = std.time.timestamp();
const dir_name = try std.fmt.allocPrint(self.allocator, "gossip-dumps/{}", .{start_time});
defer self.allocator.free(dir_name);
const dir_name_bounded = sig.utils.fmt.boundedFmt("gossip-dumps/{}", .{start_time});

var dir = try std.fs.cwd().makeOpenPath(dir_name, .{});
var dir = try std.fs.cwd().makeOpenPath(dir_name_bounded.constSlice(), .{});
defer dir.close();

while (true) {
Expand Down

0 comments on commit 6c83b66

Please sign in to comment.