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 {
214214 ignore_unknown_fields: bool = false,
215215};
216216
217/// Parses the given slice as ZON.
218///
219/// Human readable errors are written to `options.errors`. `options.arena` owns the errors, and any
220/// pointers that are part of `T`.
217/// Parses the given slice as ZON, writing any errors to `options.errors`.
221218pub fn fromSlice(T: type, options: Options) error{ OutOfMemory, ParseZon }!T {
222219 var value: T = undefined;
223220 try fromSliceInner(T, &value, false, options);
......@@ -269,11 +266,12 @@ pub fn fromSliceNoAlloc(T: type, options: Options) error{ OutOfMemory, ParseZon
269266 return fromSlice(T, options);
270267}
271268
272/// Similar to `fromSlice`, but updates `value` in place. `value` must be initialized before this
273/// call, fields not specified in ZON are left unchanged.
269/// Similar to `fromSlice`, but updates the existing contents of `value` in place. Fields
270/// unspecified by ZON are left unchanged.
274271///
275/// Whenever a slice or an untagged union is specified, it completely overwites the previous value.
276/// On error, `value` remains valid, but may be partially updated.
272/// Assumes that `value` points to a fully initialized value prior to this call. Slices and untagged
273/// unions are replaced in their entirey when specified. On error, `value` remains valid, but may be
274/// partially updated.
277275pub fn updateFromSlice(
278276 T: type,
279277 value: *T,