You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am thinking about the following usecase: When I have a application where I can define regexes in a config file and the app reads the config on boot, I cannot use serde_derive with Regex:
Using serde_regex might actually not be a great idea. A serialize-deserialize roundtrip will drop flags, as reported here: tailhook/serde-regex#14. Which means after deserialization you can end up with a Regex that's semantically different from what you had before, which depending on your use case might cause all kinds of correctness bugs.
Skimming the API of the Regex type it doesn't seem to provide a way to retrieve the flags used to compile it, so there is not much serde_regex can do about this.
This is somewhat related to #258
I am thinking about the following usecase: When I have a application where I can define regexes in a config file and the app reads the config on boot, I cannot use
serde_derive
withRegex
:But it would be nice to have that possibility. What do you think? Or is there a boilerplate-free way around this I do not see right now?
The text was updated successfully, but these errors were encountered: