bobulous, I have, belatedly, realised that my #Rust #XML parser needs to use dynamic dispatch, because the character encoding can only be determined at runtime. Which means all of my rigidly static generic structs need to have dynamic equivalents. But I want to keep the static generic versions too, so that (for example) a JSON parser can be built from them (JSON is always UTF-8 so no need for runtime determination).
The dynamic/static files are almost identical. Any way to avoid duplication?
Add comment