From c6281d2433399f5462f927768d58a2845017bd70 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 26 Feb 2026 13:09:10 +0100 Subject: [PATCH] fix: unwatch cannot error --- src/nightwatch.zig | 2 +- src/nightwatch_test.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nightwatch.zig b/src/nightwatch.zig index b9f4431..85d22a5 100644 --- a/src/nightwatch.zig +++ b/src/nightwatch.zig @@ -72,7 +72,7 @@ pub fn watch(self: *@This(), path: []const u8) Error!void { } /// Stop watching a previously watched path -pub fn unwatch(self: *@This(), path: []const u8) Error!void { +pub fn unwatch(self: *@This(), path: []const u8) void { self.backend.remove_watch(self.allocator, path); } diff --git a/src/nightwatch_test.zig b/src/nightwatch_test.zig index d14ba6f..e364d8d 100644 --- a/src/nightwatch_test.zig +++ b/src/nightwatch_test.zig @@ -393,7 +393,7 @@ test "unwatch stops delivering events for that directory" { try std.testing.expect(th.hasChange(file1, .created)); // Stop watching, then create another file - must NOT appear. - try watcher.unwatch(tmp); + watcher.unwatch(tmp); const count_before = th.events.items.len; const file2 = try std.fmt.allocPrint(allocator, "{s}/after_unwatch.txt", .{tmp});