refactor: create new run function in main using anytype
Some checks failed
ci/crow/push/release Pipeline was successful
ci/crow/tag/build Pipeline failed

This commit is contained in:
Grace Yoder 2026-06-25 11:47:54 -06:00
parent ecdcf0c0b8
commit a553c9b060
Signed by: grace
SSH key fingerprint: SHA256:oG9v0ZlohsoMAg083HAwBGOcaPLF3nIuOlAW4MtASMo

View file

@ -11,11 +11,16 @@ pub fn main(init: std.process.Init) !void {
std.process.exit(1);
}
std.debug.print("\x1b[0;32mCopying the following to Pasteboard\x1b[0m\n", .{});
// We want to avoid doing as many allocations as possible so having raw
// pages with it being larger should be totally fine
var clip = try Clip.OSC52.init(std.heap.page_allocator, init.io, std.heap.pageSize());
defer clip.free();
run(io, clip);
}
pub fn run(io: *std.Io, clip: anytype) !void {
std.debug.print("\x1b[0;32mCopying the following to Pasteboard\x1b[0m\n", .{});
var buf: [4096]u8 = undefined;
while (true) {