Skip to content

Commit 8a0ffdf

Browse files
committed
Since this got fixed within the stdlib, the capacity fn no longer needs a mutable pointer and I also removed the relevant note comment about this. Updated docs to reflect this change
1 parent ead8a26 commit 8a0ffdf

File tree

5 files changed

+4
-8
lines changed

5 files changed

+4
-8
lines changed

docs/sources.tar

-512 Bytes
Binary file not shown.

src/array_hash_set/managed.zig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ pub fn ArraySetManaged(comptime E: type) type {
102102

103103
/// Returns the number of total elements which may be present before
104104
/// it is no longer guaranteed that no allocations will be performed.
105-
pub fn capacity(self: *Self) Size {
106-
// Note: map.capacity() requires mutable access, probably an oversight.
105+
pub fn capacity(self: Self) Size {
107106
return self.unmanaged.capacity();
108107
}
109108

src/array_hash_set/unmanaged.zig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ pub fn ArraySetUnmanaged(comptime E: type) type {
106106

107107
/// Returns the number of total elements which may be present before
108108
/// it is no longer guaranteed that no allocations will be performed.
109-
pub fn capacity(self: *Self) Size {
110-
// Note: map.capacity() requires mutable access, probably an oversight.
109+
pub fn capacity(self: Self) Size {
111110
return self.unmanaged.capacity();
112111
}
113112

src/hash_set/managed.zig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ pub fn HashSetManagedWithContext(comptime E: type, comptime Context: type, compt
134134

135135
/// Returns the number of total elements which may be present before
136136
/// it is no longer guaranteed that no allocations will be performed.
137-
pub fn capacity(self: *Self) Size {
138-
// Note: map.capacity() requires mutable access, probably an oversight.
137+
pub fn capacity(self: Self) Size {
139138
return self.map.capacity();
140139
}
141140

src/hash_set/unmanaged.zig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ pub fn HashSetUnmanagedWithContext(comptime E: type, comptime Context: type, com
142142

143143
/// Returns the number of total elements which may be present before
144144
/// it is no longer guaranteed that no allocations will be performed.
145-
pub fn capacity(self: *Self) Size {
146-
// Note: map.capacity() requires mutable access, probably an oversight.
145+
pub fn capacity(self: Self) Size {
147146
return self.unmanaged.capacity();
148147
}
149148

0 commit comments

Comments
 (0)