authorgravatar for mason@gamesbymason.comMason Remaley <mason@gamesbymason.com> 2026-08-12 15:16:02-07:00
committergravatar for mason@gamesbymason.comMason Remaley <mason@gamesbymason.com> 2026-09-26 12:35:38-07:00
loga959eadb9d0fb48c7959e5a3cd894f3d81025900
treeae4dd644580dfdead025c7b5bf26b63365a63fd7
parent472a0305b82890592095f98904eca4a1a6a4ef06

Documentation cleanup


1 files changed, 6 insertions(+), 8 deletions(-)

lib/std/zon/parse.zig+6-8
...@@ -214,10 +214,7 @@ pub const Options = struct {...@@ -214,10 +214,7 @@ pub const Options = struct {
214 ignore_unknown_fields: bool = false,214 ignore_unknown_fields: bool = false,
215};215};
216216
217/// Parses the given slice as ZON.217/// Parses the given slice as ZON, writing any errors to `options.errors`.
218///
219/// Human readable errors are written to `options.errors`. `options.arena` owns the errors, and any
220/// pointers that are part of `T`.
221pub fn fromSlice(T: type, options: Options) error{ OutOfMemory, ParseZon }!T {218pub fn fromSlice(T: type, options: Options) error{ OutOfMemory, ParseZon }!T {
222 var value: T = undefined;219 var value: T = undefined;
223 try fromSliceInner(T, &value, false, options);220 try fromSliceInner(T, &value, false, options);
...@@ -269,11 +266,12 @@ pub fn fromSliceNoAlloc(T: type, options: Options) error{ OutOfMemory, ParseZon...@@ -269,11 +266,12 @@ pub fn fromSliceNoAlloc(T: type, options: Options) error{ OutOfMemory, ParseZon
269 return fromSlice(T, options);266 return fromSlice(T, options);
270}267}
271268
272/// Similar to `fromSlice`, but updates `value` in place. `value` must be initialized before this269/// Similar to `fromSlice`, but updates the existing contents of `value` in place. Fields
273/// call, fields not specified in ZON are left unchanged.270/// unspecified by ZON are left unchanged.
274///271///
275/// Whenever a slice or an untagged union is specified, it completely overwites the previous value.272/// Assumes that `value` points to a fully initialized value prior to this call. Slices and untagged
276/// On error, `value` remains valid, but may be partially updated.273/// unions are replaced in their entirey when specified. On error, `value` remains valid, but may be
274/// partially updated.
277pub fn updateFromSlice(275pub fn updateFromSlice(
278 T: type,276 T: type,
279 value: *T,277 value: *T,