diff --git a/vlib/toml/any.v b/vlib/toml/any.v index b928e94eb0..3f99830342 100644 --- a/vlib/toml/any.v +++ b/vlib/toml/any.v @@ -227,6 +227,8 @@ fn (a Any) value_(value Any, key []string) Any { } } +// reflect returns `T` with `T.`'s value set to the +// value of any 1st level TOML key by the same name. pub fn (a Any) reflect() T { mut reflected := T{} $for field in T.fields { diff --git a/vlib/toml/toml.v b/vlib/toml/toml.v index 910f647864..a38394b9fc 100644 --- a/vlib/toml/toml.v +++ b/vlib/toml/toml.v @@ -173,6 +173,8 @@ pub fn (d Doc) to_any() Any { return ast_to_any(d.ast.table) } +// reflect returns `T` with `T.`'s value set to the +// value of any 1st level TOML key by the same name. pub fn (d Doc) reflect() T { return d.to_any().reflect() }