Skip to content

Commit 1ebbdf8

Browse files
bossley9squeek502
authored andcommitted
fix: add specific error set for SelectiveWalker iterator function
1 parent 4187d0e commit 1ebbdf8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/std/fs/Dir.zig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,10 +671,12 @@ pub const SelectiveWalker = struct {
671671
name_buffer: std.ArrayListUnmanaged(u8),
672672
allocator: Allocator,
673673

674+
pub const Error = IteratorError || Allocator.Error;
675+
674676
/// After each call to this function, and on deinit(), the memory returned
675677
/// from this function becomes invalid. A copy must be made in order to keep
676678
/// a reference to the path.
677-
pub fn next(self: *SelectiveWalker) !?Walker.Entry {
679+
pub fn next(self: *SelectiveWalker) Error!?Walker.Entry {
678680
while (self.stack.items.len > 0) {
679681
const top = &self.stack.items[self.stack.items.len - 1];
680682
var dirname_len = top.dirname_len;

0 commit comments

Comments
 (0)