Open Nicceboy opened 8 months ago
The performance impact if every character from the input stream is separately validated
I think if this is a concern we could probably look at SIMD or aho-corasick for performing the validation, those should be quick on large strings.
Should the error type be Enum with variants of every string type or Struct (everyone separately)?
I think a struct so that we can implement try_from and similar traits with the string's specific error.
Currently the decoding behaviour for restricted string types is, that on debug build, invalid character will cause panic. On release builds they are ignored, and there is no error.
There was some discussion that this should be changed, so leaving this issue as reminder.
Few things to consider: