Don't flip GUID fields when converting to UUID #540
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of #537
In #336 we introduced conversions between Windows GUIDs and UUIDs. These didn't attempt to swap the ordering of the fields in any way. GUID specifies its fields as being in the native endianness (which for Windows is basically always little endian), while UUID requires them to be big endian. So we started flipping those fields coming from GUIDs in #345. Unfortunately, this seems like it was the wrong thing to do. All GUIDs I've been able to find already have the right ordering for UUIDs, so we've just been mangling them and losing the UUID version and variant.
This PR fixes that by removing the endianness conversion. We're going to be pulling this out into a separate crate before stabilizing so we can call out the change there. Anybody who actually does want to flip bytes between GUID and UUID fields can use the
from_fields_le
andto_fields_le
methods.