-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add macro #17
Comments
Ehh, yeah, I also would love to be able to construct them from str. I wish the const functions were advanced enough to give us that for free, but we're not there yet. Pending:
I guess until then we could add |
If it works, a compromise might be a checked_tiny_str_4!(0x746F6F72, "root"); Inside the macro, you create a TinyStr using |
When using TinyStr, I find that I often want to write strings that should be statically compiled to a TinyStr. Instead, I have to pick between parsing the strings into TinyStr at runtime, or hard-coding the bits into my source file. It would be much nicer if I could do
and have that automatically compile to the TinyStr4 representation of that string (or fail to compile if the string is invalid).
The text was updated successfully, but these errors were encountered: