Add some unsafe magic for minimal optimizations, add .idea to .gitignore and fix some typos
Thanks for the amazing contribution to open source url parsing!
I am using this lib right now and thought that I should look into it a bit, I ended up doing minor changes.
I understand if the unsafe code gets rejected, but I even left some safety comments.
Also can you fix clippy errors?
I added tests and comments that illustrate which number maps to which enum variant.
Regarding the clippy errors, I don't get any.
Now let's talk about performance:
If I'm honest there will be a performance difference but it will be negligible.
But the code I wrote is 100% safe, you can trust me on that one since I added a#[repr(u32)] on the enum which allows for safe transmution between value as u32 and the enum as long as value is not bigger than the number of variants of the enum -1, but we check for that.
If you still think its risky, just deny the commit, it's alright for me.
Oh ok I should have done the assembly check myself. Thanks for pointing out that it produces the same exact instructions.