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
{{ message }}
This repository has been archived by the owner on Oct 6, 2024. It is now read-only.
Reading from the code they're seems to be some un-intentional edge cases with :camel. For example:
my__ident will be converted to MyIdent and not My_Ident.
_my_ident will be converted MyIdent intead of _MyIdent (maybe intentional)
I don't think any of the PascalCase, the CamelCase nor the snake_case conventions specify those edge cases.
My use case for 1 is the following:
We have a data base containing a table with quite a lot of colums, the columns name are therefore scoped with scope_with_multiple_words__my_name. The database is accessed with diesel, the column name is therefore taken as such. I need to convert those columns to a Grpc enum, the enum variants are scoped as: ScopeWithMultipleWords_MyName
I don't have a specific use case for 2, just found that it was weird to remove the first _ if someone intentionally put it there.
Would you be open to such change? If yes, I can submit a PR 😊
(I do realise it's a breaking change, I just don't think there's a lot of people with ident containing two or more consecutive underscore)
The text was updated successfully, but these errors were encountered:
Elrendio
changed the title
Precise behavior for snake_case edges cases
Edge cases with :camelJan 11, 2022
Hey 👋
Thanks for the awesome crate 🙏
Reading from the code they're seems to be some un-intentional edge cases with
:camel
. For example:my__ident
will be converted toMyIdent
and notMy_Ident
._my_ident
will be convertedMyIdent
intead of_MyIdent
(maybe intentional)I don't think any of the PascalCase, the CamelCase nor the snake_case conventions specify those edge cases.
My use case for 1 is the following:
We have a data base containing a table with quite a lot of colums, the columns name are therefore scoped with
scope_with_multiple_words__my_name
. The database is accessed with diesel, the column name is therefore taken as such. I need to convert those columns to a Grpc enum, the enum variants are scoped as:ScopeWithMultipleWords_MyName
I don't have a specific use case for 2, just found that it was weird to remove the first
_
if someone intentionally put it there.Would you be open to such change? If yes, I can submit a PR 😊
(I do realise it's a breaking change, I just don't think there's a lot of people with ident containing two or more consecutive underscore)
The text was updated successfully, but these errors were encountered: