build(zig-0.16): update example code in README and examples/ for zig-0.16
This commit is contained in:
parent
82b095bdb8
commit
815146c375
4 changed files with 16 additions and 17 deletions
|
|
@ -23,11 +23,10 @@ const H = struct {
|
|||
}
|
||||
};
|
||||
|
||||
pub fn main() !void {
|
||||
const allocator = std.heap.page_allocator;
|
||||
pub fn main(init: std.process.Init) !void {
|
||||
var h = H{ .handler = .{ .vtable = &H.vtable } };
|
||||
var watcher = try nightwatch.Default.init(allocator, &h.handler);
|
||||
var watcher = try nightwatch.Default.init(init.io, init.gpa, &h.handler);
|
||||
defer watcher.deinit();
|
||||
try watcher.watch(".");
|
||||
std.Thread.sleep(std.time.ns_per_s * 60);
|
||||
std.Io.sleep(init.io, std.Io.Duration.fromMilliseconds(60_000), .awake) catch {};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,10 +38,9 @@ const H = struct {
|
|||
}
|
||||
};
|
||||
|
||||
pub fn main() !void {
|
||||
const allocator = std.heap.page_allocator;
|
||||
pub fn main(init: std.process.Init) !void {
|
||||
var h = H{ .handler = .{ .vtable = &H.vtable } };
|
||||
var watcher = try Watcher.init(allocator, &h.handler);
|
||||
var watcher = try Watcher.init(init.io, init.gpa, &h.handler);
|
||||
defer watcher.deinit();
|
||||
try watcher.watch(".");
|
||||
|
||||
|
|
|
|||
|
|
@ -35,11 +35,10 @@ const H = struct {
|
|||
}
|
||||
};
|
||||
|
||||
pub fn main() !void {
|
||||
const allocator = std.heap.page_allocator;
|
||||
pub fn main(init: std.process.Init) !void {
|
||||
var h = H{ .handler = .{ .vtable = &H.vtable } };
|
||||
var watcher = try Watcher.init(allocator, &h.handler);
|
||||
var watcher = try Watcher.init(init.io, init.gpa, &h.handler);
|
||||
defer watcher.deinit();
|
||||
try watcher.watch(".");
|
||||
std.Thread.sleep(std.time.ns_per_s * 60);
|
||||
std.Io.sleep(init.io, std.Io.Duration.fromMilliseconds(60_000), .awake) catch {};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue