aboutsummaryrefslogtreecommitdiff
path: root/lib/std/io/reader.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-11-30 01:44:34 -0500
committerGitHub <noreply@github.com>2022-11-30 01:44:34 -0500
commite35f297aeb993ec956ae80379ddf7f86069e109b (patch)
tree45cbb5b3ebbe23a46e27b04aa5898a6c00ec4a61 /lib/std/io/reader.zig
parentdeda6b514691c3a7ffc7931469886d0e7be2f67e (diff)
parentf4666678886c2a7a993ad30b63de4ff25594085a (diff)
downloadzig-e35f297aeb993ec956ae80379ddf7f86069e109b.tar.gz
zig-e35f297aeb993ec956ae80379ddf7f86069e109b.zip
Merge pull request #13666 from ziglang/allocator-interface
std.mem.Allocator: allow shrink to fail
Diffstat (limited to 'lib/std/io/reader.zig')
-rw-r--r--lib/std/io/reader.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/io/reader.zig b/lib/std/io/reader.zig
index 6acc004851..b86aca6cbd 100644
--- a/lib/std/io/reader.zig
+++ b/lib/std/io/reader.zig
@@ -176,11 +176,11 @@ pub fn Reader(
error.EndOfStream => if (array_list.items.len == 0) {
return null;
} else {
- return array_list.toOwnedSlice();
+ return try array_list.toOwnedSlice();
},
else => |e| return e,
};
- return array_list.toOwnedSlice();
+ return try array_list.toOwnedSlice();
}
/// Reads from the stream until specified byte is found. If the buffer is not