tiberius icon indicating copy to clipboard operation
tiberius copied to clipboard

Add builder pattern for Config

Open LonerDan opened this issue 1 year ago • 0 comments

Changes the way Config is constructed by introducing helper struct ConfigBuilder, which follows the builder pattern. This enables more ergonomic function call chaining, while still preserving the option to call them one by one as previously.

Based on this and this, the variant consuming and producing mutable references was chosen, since it allows both ergonomic function call chaining and manually calling individual functions, which is required in case of values set conditionally. As a side effect, this also allows constructing multiple Configs from the same builder.

LonerDan avatar Oct 29 '24 12:10 LonerDan