fix: unwatch cannot error

This commit is contained in:
CJ van den Berg 2026-02-26 13:09:10 +01:00
parent 2c4f752186
commit c6281d2433
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 2 additions and 2 deletions

View file

@ -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);
}

View file

@ -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});