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

Always rustify member names #82

Merged
merged 1 commit into from
Aug 3, 2022
Merged

Always rustify member names #82

merged 1 commit into from
Aug 3, 2022

Conversation

clux
Copy link
Member

@clux clux commented Aug 2, 2022

Breaking change to make variables always follow rust conventions.

This avoids a number of problems:

And as a result we get to remove two options that generally had a
"correct choice"

  • --rust-case or -z (now implied default) so option removed
  • --hide-inner-attr or -i only mattered if you didn't use -z so removed

Thus the generated case for crds now always follow the standard rust convention:

  • struct members use snake_case
  • enum members use PascalCase

(and this is a safe rename because we knew the original name so we just emit a serde(rename) attr to ensure serialization uses the correct keys)

@clux clux linked an issue Aug 2, 2022 that may be closed by this pull request
@clux
Copy link
Member Author

clux commented Aug 2, 2022

cc @felipesere

Breaking change to make variables always follow rust conventions.

This avoids a number of problems:

- the need to omit an inner attribute in a generated file to allow
  non_snake_cased vars (see #69)
- unhelpful crashes because of non-rust conventioned keys (see #81)

And as a result we get to remove two options that generally had a
"correct choice"

- --rust-case or -z (now implied default) so option removed
- --hide-inner-attr or -i only mattered if you didn't use -z so removed

Signed-off-by: clux <sszynrae@gmail.com>
@clux clux merged commit be5ced7 into main Aug 3, 2022
@clux clux deleted the always-rustify-names branch August 3, 2022 08:50
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

Successfully merging this pull request may close these issues.

crash on flux's GitRepository crd
1 participant