aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-11-27 01:07:35 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-11-29 23:30:38 -0700
commitceb0a632cfd6a4eada6bd27bf6a3754e95dcac86 (patch)
tree3c174281ab0b9d51b6c78234b0648e197412eea8 /doc
parentdeda6b514691c3a7ffc7931469886d0e7be2f67e (diff)
downloadzig-ceb0a632cfd6a4eada6bd27bf6a3754e95dcac86.tar.gz
zig-ceb0a632cfd6a4eada6bd27bf6a3754e95dcac86.zip
std.mem.Allocator: allow shrink to fail
closes #13535
Diffstat (limited to 'doc')
-rw-r--r--doc/docgen.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/docgen.zig b/doc/docgen.zig
index 3ba9a1442c..bf70cef5e4 100644
--- a/doc/docgen.zig
+++ b/doc/docgen.zig
@@ -471,7 +471,7 @@ fn genToc(allocator: Allocator, tokenizer: *Tokenizer) !Toc {
},
Token.Id.Separator => {},
Token.Id.BracketClose => {
- try nodes.append(Node{ .SeeAlso = list.toOwnedSlice() });
+ try nodes.append(Node{ .SeeAlso = try list.toOwnedSlice() });
break;
},
else => return parseError(tokenizer, see_also_tok, "invalid see_also token", .{}),
@@ -610,7 +610,7 @@ fn genToc(allocator: Allocator, tokenizer: *Tokenizer) !Toc {
.source_token = source_token,
.just_check_syntax = just_check_syntax,
.mode = mode,
- .link_objects = link_objects.toOwnedSlice(),
+ .link_objects = try link_objects.toOwnedSlice(),
.target_str = target_str,
.link_libc = link_libc,
.backend_stage1 = backend_stage1,
@@ -707,8 +707,8 @@ fn genToc(allocator: Allocator, tokenizer: *Tokenizer) !Toc {
}
return Toc{
- .nodes = nodes.toOwnedSlice(),
- .toc = toc_buf.toOwnedSlice(),
+ .nodes = try nodes.toOwnedSlice(),
+ .toc = try toc_buf.toOwnedSlice(),
.urls = urls,
};
}
@@ -729,7 +729,7 @@ fn urlize(allocator: Allocator, input: []const u8) ![]u8 {
else => {},
}
}
- return buf.toOwnedSlice();
+ return try buf.toOwnedSlice();
}
fn escapeHtml(allocator: Allocator, input: []const u8) ![]u8 {
@@ -738,7 +738,7 @@ fn escapeHtml(allocator: Allocator, input: []const u8) ![]u8 {
const out = buf.writer();
try writeEscaped(out, input);
- return buf.toOwnedSlice();
+ return try buf.toOwnedSlice();
}
fn writeEscaped(out: anytype, input: []const u8) !void {
@@ -854,7 +854,7 @@ fn termColor(allocator: Allocator, input: []const u8) ![]u8 {
},
}
}
- return buf.toOwnedSlice();
+ return try buf.toOwnedSlice();
}
const builtin_types = [_][]const u8{