We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39fa313 commit 1a9d2f3Copy full SHA for 1a9d2f3
std/buffer.zig
@@ -41,9 +41,9 @@ pub const Buffer = struct {
41
/// Buffer takes ownership of the passed in slice. The slice must have been
42
/// allocated with `allocator`.
43
/// Must deinitialize with deinit.
44
- pub fn fromOwnedSlice(allocator: *Allocator, slice: []u8) Buffer {
+ pub fn fromOwnedSlice(allocator: *Allocator, slice: []u8) !Buffer {
45
var self = Buffer{ .list = ArrayList(u8).fromOwnedSlice(allocator, slice) };
46
- self.list.append(0);
+ try self.list.append(0);
47
return self;
48
}
49
0 commit comments