-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Requiring version string have static lifetime makes for awkward code #28
Comments
I'll take a look at this tonight and report back. Thanks for the detailed write up! |
Thanks for taking a look! This library has been working really well for me so far. :) |
I got it working in a backwards compat way allowing lifetimes other than 'static. 0.4.14 on crates.io (or master branch here) should be working for you now. Let me know if that fixed what you needed. And I like your example for auto-generating the version from the Cargo.toml, I'm gonna throw that in the examples dir. Thanks again 👍 |
Yup, works like a charm. Thank you! |
In trying to get the version string to automatically populate based on the version I specify in my
Cargo.toml
using something like:However, this fails with:
I can get it to work if I don't care about the prerelease marker, and switch to
concat!
(haven't been able to getconcat!
to play nicely withoption_env!
):Sticking with
format!
so I can useoption_env!
is really not nice (as it involves unsafe code provided by dougxxx in the #rust IRC channel):Is there a way the elements of the App struct could be changed to not require static lifetimes on its elements? I haven't looked at what the implications of this would be with the rest of the code, but allowing the
format!
trick I initially tried for defining the version seems like reasonable usage of the library.The text was updated successfully, but these errors were encountered: