Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit fixes an issue with `convert_case` crate reported in [1]. The issue is that the default implementation of `is_case` provided by that crate initializes the converter with almost all available boundaries. As a result the following conversion takes place: "ERR1".to_case(Case::UpperSnake) -> "ERR_1" Furthermore, the following check fails, while it seems like it shouldn't because the string is in capital letters. "ERR1".is_case(Case::UpperSnake) This commit introduces a new primitive `convert_case` which receives two case parameters, one for the source case and one of the target case. This way the converter is initialized with the correct source case boundaries. And it allows implementation of a new `is_case` primitive that builds on `convert_case` to select the source case boundaries correctly. [1] rutrum/convert-case#21
- Loading branch information