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
Fixed uuid!("")
macro diagnostics when using urn:uuid
prefix.
#554
Fixed uuid!("")
macro diagnostics when using urn:uuid
prefix.
#554
Conversation
Nice catch! Looks like we’ve got a couple test failures here. I think the We also just need to make sure the parser will never panic. Maybe that should go in a comment at the top of the function? |
This was caused by a
I'm fairly confident it won't panic anymore. I also found out that it panicked when a wide char was present, so I had to add some support in the macro that fixed this. For example, the macro no longer panics on multibyte unicode:
Also, I added some util functions for creating |
} | ||
.into()); | ||
// let found = input[i_char..].chars().next().unwrap(); | ||
// let found = char::from(chr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we mean to keep these comments here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope that was an accident
const _: Uuid = uuid!("67e550-4105b1426f9247bb680e5fe0c"); | ||
|
||
const _: Uuid = uuid!("504410岡林aab1426f9247bb680e5fe0c8"); | ||
const _: Uuid = uuid!("504410😎👍aab1426f9247bb680e5fe0c8"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😎 👍
That is much easier to follow. Do we have any test cases for the |
Not yet. Also how optimized is the parsing algorithm? The more I look at it, the more it bothers me how clunky it feels, and I'd like to refactor it if you're not opposed. |
I think it's had one or two rounds of optimization applied in its lifetime, but nothing like a complete rewrite as far as I remember. If you'd like to spend some time on it that sounds fantastic! I don't mind if you just want to keep pushing changes to this PR here, or if we merge and start another. |
I'm submitting a bug fix
Description
Fixed an bug where the
uuid!("")
macro would point to the wrong characters when using theurn:uuid:
prefix or wrapping with the curly braces ("{...}"
).Related Issue(s)
none