-
Notifications
You must be signed in to change notification settings - Fork 45
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
Compile-time constant evaluation? #176
Comments
Hi @pickfire That's an interesting idea — if it's relatively easy to implement with the existing functions? I always assumed that the cost of wrapping strings would be very low. Also, I expect most programs will spend more time waiting for I/O to complete than waiting for strings to be wrapped. Do you have a different use case? |
@mgeisler Yes, it it supposed to be very low. But then is it useful to have it it runtime when we could do it during compile time? Of course some parts still won't be able to use this feature when it involves |
Thanks to @althonos, this is now possible. Please see his |
Nice, but should we mention it in README and the first page in rustdoc to make it more discoverable? Or maybe pull it into this crate behind a feature flag? |
Yeah, mentioning it in the documentation is a great idea! I don't think
Then there is no doubt as to what version is in play at any point. |
The crate makes it possible to use textwrap at compile time. Fixes #176
The crate makes it possible to use textwrap at compile time. Fixes #176
Evaluate at compile-time, zero-cost and no runtime cost at the cost of longer compile time. Of course, lazy-static and similar crates would be an option.
https://github.com/rust-lang/rfcs/blob/master/text/0246-const-vs-static.md
The text was updated successfully, but these errors were encountered: