From 7fdcb0e130635a3f17c5bddc5bc1b76584e4c48a Mon Sep 17 00:00:00 2001 From: Larsimusrex Date: Tue, 2 Sep 2025 21:30:36 +0200 Subject: [PATCH] add documentation for public functions/structs --- vlib/x/json2/encode.v | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vlib/x/json2/encode.v b/vlib/x/json2/encode.v index f4e611351b..3ba4216539 100644 --- a/vlib/x/json2/encode.v +++ b/vlib/x/json2/encode.v @@ -1,5 +1,6 @@ module json2 +// EncoderOptions provides a list of options for encoding @[params] pub struct EncoderOptions { pub: @@ -26,6 +27,7 @@ fn workaround_cast[T](val voidptr) T { return *(&T(val)) } +// encode is a generic function that encodes a type into a JSON string. pub fn encode[T](val T, config EncoderOptions) string { mut encoder := Encoder{ EncoderOptions: config