-
Notifications
You must be signed in to change notification settings - Fork 13
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
Apply linter suggestions for cleaner code #43
Conversation
Thanks for looking at this, I'm fine with the clippy fixes in the main "human written" code base, those are good. However, I don't think I want to apply them to the auto-generated code at the tail end of the shell script. Clippy re-writes things in a nontrivial way at times, and that will make it harder to track down bugs since the code we see getting written in the generation step doesn't exist 1:1 in the code being run anymore. That being said, using clippy to suggest ways we can improve code generation does seem like a very good idea, especially if they would be trivial to implement like where it changed Also I call "rustfmt" via code in the main script,
|
I think for now I'd like to drop any automatic code changes (other than the programmatically called rustfmt), so more or less removing the changes to I love the other changes, and wouldn't be opposed to updating the codegen script to create the desired output for |
3a4a89a
to
6fd653e
Compare
6fd653e
to
54206dd
Compare
As requested, I have dropped the automatic code changes (clippy fix + cargo fmt) from Also, I rebased the branch on master, as the FitSDK 21.141.00 branch was merged. |
This looks great now, I'll do some local testing probably tomorrow and get it merged in! |
Thanks! |
This PR is on top of the FitSDK 21.141.00 branch.
In this PR additionally to the SDK update, I fixed issues that the linter (clippy) was pointing out. This also involved fixes in autogenerated
profile/decode.rs
andprofile/field_types.rs
files - for this I adapted the code that generates them. Additionally I addedcargo clippy --fix
andcargo fmt
to theupdate_profile.sh
shell script, as forprofile/field_types.rs
this leads to a nice collapsing of huge match "|" cascades into simple ranges, which is much more readable (and maybe even faster, I am not sure what the compiler does).