Skip to content

Commit 00bf65b

Browse files
committed
chore(pool): expose Interface type
1 parent 543e6b0 commit 00bf65b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/core/pool.zig

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ fn Borrow(comptime T: type) type {
1010

1111
pub fn Pool(comptime T: type) type {
1212
return struct {
13-
const Iterator = struct {
13+
pub const Iterator = struct {
1414
items: []T,
15-
inner: std.DynamicBitSetUnmanaged.Iterator(.{}),
15+
inner: std.DynamicBitSetUnmanaged.Iterator(.{
16+
.kind = .set,
17+
.direction = .forward,
18+
}),
1619

1720
pub fn next(self: *Iterator) ?T {
1821
const index = self.inner.next() orelse return null;
@@ -70,7 +73,7 @@ pub fn Pool(comptime T: type) type {
7073
return self.items[index];
7174
}
7275

73-
fn get_ptr(self: *Self, index: usize) *T {
76+
fn get_ptr(self: *const Self, index: usize) *T {
7477
return &self.items[index];
7578
}
7679

@@ -132,7 +135,7 @@ pub fn Pool(comptime T: type) type {
132135
}
133136

134137
/// Returns an iterator over the taken values in the Pool.
135-
pub fn iterator(self: *Self) Iterator {
138+
pub fn iterator(self: *const Self) Iterator {
136139
const iter = self.dirty.iterator(.{});
137140
const items = self.items;
138141
return .{ .inner = iter, .items = items };

0 commit comments

Comments
 (0)