-
Notifications
You must be signed in to change notification settings - Fork 192
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 uuid! macro to produce compile-time Uuids from strings. #395
Conversation
explain multiple segment count.Parsers can expect a range of Uuid segment count. Lines 57 to 62 in 1a4d28c
This comment was generated by todo based on a
|
explain multiple lengths.Parsers can expect a range of Uuid lenghts. Lines 80 to 85 in 1a4d28c
This comment was generated by todo based on a
|
remove the u8 castthis only needed until we switch to Lines 192 to 197 in 1a4d28c
This comment was generated by todo based on a
|
remove the u8 castthis only needed until we switch to Lines 199 to 204 in 1a4d28c
This comment was generated by todo based on a
|
remove the u8 castthis only needed until we switch to Lines 240 to 245 in 1a4d28c
This comment was generated by todo based on a
|
remove the u8 castthis only needed until we switch to Lines 270 to 275 in 1a4d28c
This comment was generated by todo based on a
|
Thanks for this PR. However I am not yet comfortable with including this into the main crate. However we have an inactive crate (uuid-rs/uuid_macro) which was designed for this for this purpose (polish it out and then introduced). I would love if you open this again that. And post that I think it would be a good point to publish that crate aswell |
That crate looks similar enough. I hadn't noticed it. Though I don't see how I could improve the crate much (from a quick glance) without the split here to move out I'd recommend renaming it to |
I'm submitting a(n) feature|refactor
Description
This moves out parsing into its own crate,
uuid-parser
; and, adds a third crate,uuid-macros
, with a single expression proc-macrouuid!
that can produce compile-time UUIDs from strings.As this is a pretty invasive refactor, please let me know if there are changes to the organization you'd like me to make.
Motivation
Replaces:
With:
Furthermore, after #394, this enables const UUIDs to be
const
themselves.Tests
A new test was added to showcase
uuid!
and prove it works.Related Issue(s)