Skip to content

Commit

Permalink
x.json2: make public the generic function map_from/1 (#20294)
Browse files Browse the repository at this point in the history
  • Loading branch information
esquerbatua committed Dec 29, 2023
1 parent fe017af commit db80a00
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vlib/x/json2/json2.v
Expand Up @@ -429,7 +429,8 @@ pub fn (f Any) to_time() !time.Time {
}
}

fn map_from[T](t T) map[string]Any {
// map_from convert a struct to map of Any
pub fn map_from[T](t T) map[string]Any {
mut m := map[string]Any{}
$if T is $struct {
$for field in T.fields {
Expand Down

0 comments on commit db80a00

Please sign in to comment.