-
Notifications
You must be signed in to change notification settings - Fork 151
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
UPPER CASE, lower case and Title Case #803
Comments
You can specify it by |
That's cool. But why is the default the way it is? |
I don't have answer. |
Maybe it's worth looking into changing the default to PascalCase, I can't think of any reasons to not do it except that it's a breaking change |
I would support changing the default - it would make teaching easier... (see https://github.com/ferrous-systems/rust-training/blob/main/training-slides/src/pac-svd2rust.md for my slides on this topic). Anyone who objected to the massive diff next time they rebuild can add a config file to put it back as it was, right? Also perhaps the config file can help when it comes to removing (or not) the singleton objects. |
We should also split option for peripheral types and peripheral singletons. Now it is one option. And maybe modules? (Not sure) |
🤦 Lines 156 to 159 in 869d34f
|
In Rust, we typically use
TitleCase
for types (likestruct Uart0 { .. .}
), andlower_case
for module names (likepac::uart0
), method/function names (likemy_uart.baudrate()
), and field names within structs (likemy_uart.baudrate
). Things that areUPPER_CASE
are typically only static variables and constants.The code generated by svd2rust currently uses a lot of
UPPER_CASE
names for types, and also for the field names instruct Peripherals
. I think this can be confusing for a newcomer to Embedded Rust.UPPER_CASE
here?The text was updated successfully, but these errors were encountered: