serde-hex icon indicating copy to clipboard operation
serde-hex copied to clipboard

Improve configuration ergonomics.

Open fspmarshall opened this issue 5 years ago • 0 comments

As it stands, configuration must be applied as a generic type parameter (e.g. SerHex::<MyConfig>). All possible combinations are represented as individual unit structs in the config module. This is going to get cumbersome fast if more options are added.

Potential solution: expose a macro for easily generating custom config types:

hex_config! {
    Foo => {
        hello: true,
        world: false,
    },
    // ...
};

fspmarshall avatar Jun 01 '19 00:06 fspmarshall