Commit graph

11 commits

Author SHA1 Message Date
squidink7
12ee3fa86a
toml: add decoding for struct fields of type map[string]T (#19447) 2023-09-26 12:53:24 +03:00
Tobias Neitzel
3fb1230cc3
toml: fix toml encoding of complex types (#19408)
* Improve default toml encoder for complex types

The default toml encoder failed for more complex structs, as certain
edge cases were not covered. This commit attempts to fix this by adding
additional handling for these edge cases.

* Improve map encoding

Since maps currently only support keys that have a string
representation, we can utilize this during map encoding.

* Add test cases for toml encoding

Added test cases for toml encoding of complex nested structs and structs
that contain maps.

* Add additional test cases
2023-09-22 13:00:10 +03:00
Turiiya
4d8b2e9995
toml: fix custom to_toml for complex structs (#19338) 2023-09-13 12:48:14 +03:00
Turiiya
140b5a3e39
toml: implement decode method for Doc (#19318) 2023-09-11 06:26:34 +03:00
Turiiya
12dd6e8b39
toml: add comptime check if a supported type (struct) was passed to toml.decode, when the type has no custom .from_toml method defined (#19317) 2023-09-10 17:32:02 +03:00
Turiiya
1bed0b5e68
toml: add generic automatic decoding and encoding of simple structs, when they don't implement custom methods (#17970) 2023-08-15 12:06:57 +03:00
Swastik Baranwal
da68b2d369
checker: remove c.pref.is_test exception for calling private methods in _other_ modules (#16872) 2023-01-05 15:41:18 +02:00
yuyi
ef5be22f81
all: replace generic <> with [] - part 2 (#16536) 2022-11-26 18:23:26 +02:00
yuyi
017ace6ea7
vfmt: change all '$expr' to '${expr}' (#16428) 2022-11-15 16:53:13 +03:00
Swastik Baranwal
b584e1df98
checker: allow EnumName(number) casts only inside unsafe{} blocks (#15932) 2022-10-02 22:39:11 +03:00
Larpon
2b4f7e7685
toml: add encode<T> and decode<T> (#13244) 2022-01-21 21:21:31 +02:00