ianprime0509 / zig-xml

XML parser for Zig
http://ianjohnson.dev/zig-xml/
BSD Zero Clause License
14 stars 3 forks source link

Make decoder type an option for `Reader` and `TokenReader` #20

Closed ianprime0509 closed 11 months ago

ianprime0509 commented 1 year ago

Currently, the decoder to use when reading is a separate argument to the reader and tokenReader functions, and the decoder type is a separate type argument to Reader and TokenReader. With a slight decrease in flexibility, we can eliminate these extra parameters by making the decoder type an additional option in the associated options struct and requiring it to be constructable as Decoder{}.

This would reduce the number of parameters involved and the overall complexity of the API.