Skip to content
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

Make conversion methods consistent across the API #558

Merged
merged 2 commits into from Nov 3, 2021
Merged

Make conversion methods consistent across the API #558

merged 2 commits into from Nov 3, 2021

Conversation

KodrAus
Copy link
Member

@KodrAus KodrAus commented Nov 3, 2021

This PR removes the explicit Ref types for different formats in favor of casting a &Uuid. This is safe to do because the format types are #[repr(transparent)] and Copy.

I've also made the naming conventions consistent for all methods that produce and return Uuids and enhanced the docs.

@KodrAus
Copy link
Member Author

KodrAus commented Nov 3, 2021

@kinggoesgaming This basically changes our format adapters to be a single type. We make a reference to these types from a UUID when we want to avoid copying. This is a safe transmute because they’ve got the same ABI, implement Copy, and don’t implement Drop.

@KodrAus KodrAus merged commit e6a6dbd into uuid-rs:main Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant