fix: unwatch cannot error
This commit is contained in:
parent
2c4f752186
commit
c6281d2433
2 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue