mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
cdp: explain buffer size for int serialization
This commit is contained in:
@@ -230,6 +230,7 @@ pub const Writer = struct {
|
|||||||
switch (value) {
|
switch (value) {
|
||||||
.integer => |v| {
|
.integer => |v| {
|
||||||
// CDP spec requires integer values to be serialized as strings.
|
// CDP spec requires integer values to be serialized as strings.
|
||||||
|
// 20 bytes is enough for the decimal representation of a 64-bit integer.
|
||||||
var buf: [20]u8 = undefined;
|
var buf: [20]u8 = undefined;
|
||||||
const s = try std.fmt.bufPrint(&buf, "{d}", .{v});
|
const s = try std.fmt.bufPrint(&buf, "{d}", .{v});
|
||||||
try w.write(s);
|
try w.write(s);
|
||||||
|
|||||||
Reference in New Issue
Block a user