avacore1337 / OneLife

My Vue/WASM/Rust idle game
https://avacore1337.github.io/OneLife/
MIT License
1 stars 2 forks source link

remove unnecessary const declarations #15

Closed dimitrilw closed 1 year ago

dimitrilw commented 1 year ago

Since implementing the new variant_count crate's VariantCount Derive macro, many (all?) of the related const variables can be removed. Some will be easy, like TUTORIAL_STEP_SIZE, which is created once & used once in the same file.

image

Others will take a bit more work, like WORK_SIZE, which is imported in many files, so there will be more refactoring and risk of error.

image
avacore1337 commented 1 year ago

most of these should probably be "if it compiles it works" That's what I've really liked working with Rust on this project.

dimitrilw commented 1 year ago

Fair enough. Also, doubling back on it, I think these const values give some nice explicit readability to the code. I'm going to close this one out.

And my apologies for being a pedantic old jerk. I have many years of professional "step in and tweak the code to adhere to standards and/or optimize".... so some of my poking around here is just bad habits -- good habits in the workplace; bad when I'm stepping on others' toes.

Thank you for being patient with me.