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

Make use of associated constants #23

Open
neachdainn opened this issue Aug 31, 2017 · 2 comments
Open

Make use of associated constants #23

neachdainn opened this issue Aug 31, 2017 · 2 comments

Comments

@neachdainn
Copy link
Collaborator

There was a bit of a hack to handle constants in the LCM definition files. All of that is moot now that Rust 1.20 has implemented associated constants. This should simplify the mod structure of the generated Rust and be more like what the C++ version.

@neachdainn
Copy link
Collaborator Author

Another thing that could be done is make the hash an associated constant. I'm not 100% on whether or not the hash function is called often enough to make that change worth the effort, but it is possible and I don't see any downsides.

@adeschamps
Copy link
Owner

I definitely agree. Even though I expect the compiler would inline those functions, they really should be constants now that that feature is available.

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

No branches or pull requests

2 participants