| ... | @@ -41,9 +41,9 @@ pub const Buffer = struct { | ... | @@ -41,9 +41,9 @@ pub const Buffer = struct { |
| 41 | /// Buffer takes ownership of the passed in slice. The slice must have been | 41 | /// Buffer takes ownership of the passed in slice. The slice must have been |
| 42 | /// allocated with `allocator`. | 42 | /// allocated with `allocator`. |
| 43 | /// Must deinitialize with deinit. | 43 | /// Must deinitialize with deinit. |
| 44 | pub fn fromOwnedSlice(allocator: *Allocator, slice: []u8) Buffer { | 44 | pub fn fromOwnedSlice(allocator: *Allocator, slice: []u8) !Buffer { |
| 45 | var self = Buffer{ .list = ArrayList(u8).fromOwnedSlice(allocator, slice) }; | 45 | var self = Buffer{ .list = ArrayList(u8).fromOwnedSlice(allocator, slice) }; |
| 46 | self.list.append(0); | 46 | try self.list.append(0); |
| 47 | return self; | 47 | return self; |
| 48 | } | 48 | } |
| 49 | | 49 | |