Skip to content

case_insensitive flag falls off #14

Open
@ggevay

Description

@ggevay

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions