Commit df394faf77

Henry Kupty <hkupty@gmail.com>
2025-09-25 22:20:52
feat: Reintroduce depth
Some decision-making might depend on the level of the traversal, so it makes sense to expose depth here since it's stable, and not in the automatic walker where it's not.
1 parent 760127a
Changed files (1)
lib
std
lib/std/fs/Dir.zig
@@ -732,6 +732,10 @@ pub const SelectiveWalker = struct {
         });
     }
 
+    pub fn depth(self: *SelectiveWalker) usize {
+        return self.stack.items.len;
+    }
+
     pub fn deinit(self: *SelectiveWalker) void {
         self.name_buffer.deinit(self.allocator);
         self.stack.deinit(self.allocator);