Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

case_insensitive flag falls off #14

Open
ggevay opened this issue Jul 16, 2023 · 0 comments
Open

case_insensitive flag falls off #14

ggevay opened this issue Jul 16, 2023 · 0 comments

Comments

@ggevay
Copy link

ggevay commented Jul 16, 2023

One can build a regex with the case_insensitive flag like this:

let mut regex_builder = RegexBuilder::new("AAA");
regex_builder.case_insensitive(true);
let regex = regex_builder.build()?;

After roundtripping this regex through the serialize-deserialize functions derived by serde-regex, we lose the case_insensitive flag. This is because the derived serialize simply serializes the result of calling as_str() on the regex, which returns the original regex string ("AAA" in the above example), but doesn't include the flag.

I have a test here that is failing due to this bug: https://github.com/ggevay/materialize/blob/ilike-fixes-serde_derive-bug/src/repr/src/adt/regex.rs#L162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant