mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
fix: add specific error set for SelectiveWalker iterator function
This commit is contained in:
parent
4187d0e8fe
commit
1ebbdf8eef
1 changed files with 3 additions and 1 deletions
|
|
@ -671,10 +671,12 @@ pub const SelectiveWalker = struct {
|
||||||
name_buffer: std.ArrayListUnmanaged(u8),
|
name_buffer: std.ArrayListUnmanaged(u8),
|
||||||
allocator: Allocator,
|
allocator: Allocator,
|
||||||
|
|
||||||
|
pub const Error = IteratorError || Allocator.Error;
|
||||||
|
|
||||||
/// After each call to this function, and on deinit(), the memory returned
|
/// After each call to this function, and on deinit(), the memory returned
|
||||||
/// from this function becomes invalid. A copy must be made in order to keep
|
/// from this function becomes invalid. A copy must be made in order to keep
|
||||||
/// a reference to the path.
|
/// a reference to the path.
|
||||||
pub fn next(self: *SelectiveWalker) !?Walker.Entry {
|
pub fn next(self: *SelectiveWalker) Error!?Walker.Entry {
|
||||||
while (self.stack.items.len > 0) {
|
while (self.stack.items.len > 0) {
|
||||||
const top = &self.stack.items[self.stack.items.len - 1];
|
const top = &self.stack.items[self.stack.items.len - 1];
|
||||||
var dirname_len = top.dirname_len;
|
var dirname_len = top.dirname_len;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue