mirror of
https://github.com/vlang/v.git
synced 2025-09-22 11:57:33 -04:00
x.json2: make public the generic function map_from/1
(#20294)
This commit is contained in:
parent
fe017afeb0
commit
db80a002d6
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user