| ... | ... | @@ -18,14 +18,14 @@ const testing = std.testing; |
| 18 | 18 | pub fn BoundedArray(comptime T: type, comptime capacity: usize) type { |
| 19 | 19 | return struct { |
| 20 | 20 | const Self = @This(); |
| 21 | | buffer: [capacity]T, |
| 21 | buffer: [capacity]T = undefined, |
| 22 | 22 | len: usize = 0, |
| 23 | 23 | |
| 24 | 24 | /// Set the actual length of the slice. |
| 25 | 25 | /// Returns error.Overflow if it exceeds the length of the backing array. |
| 26 | 26 | pub fn init(len: usize) !Self { |
| 27 | 27 | if (len > capacity) return error.Overflow; |
| 28 | | return Self{ .buffer = undefined, .len = len }; |
| 28 | return Self{ .len = len }; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /// View the internal array as a mutable slice whose size was previously set. |