-
Notifications
You must be signed in to change notification settings - Fork 23
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
const getter #31
Comments
Great idea. :) |
Just checked in, this is still unstable. :( |
This is stable const fn get_value(&self) -> &String {
&self.value
} |
Correct, but the generic case is not. :( |
Any updates to this? It doesn't seem reasonable to put this on hold just because of a special case. |
I was working on a rewrite of this lib to better support features like this, but it's not done yet. You're welcome to contribute a patch to add this feature, or as always, write the getters and setters yourself (as is probably best!). |
Most, if not all getters (generic function parameters are currently unstable) can be const functions
https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
The text was updated successfully, but these errors were encountered: