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

Add `cast_unit` to the rest of the basic geometric types #376

Merged
merged 2 commits into from Nov 16, 2019

Conversation

@kyren
Copy link
Contributor

kyren commented Nov 16, 2019

This is much more convenient than X::from_untyped(x.to_untyped()), and previously only existed on Vector2D.

The implementation on Vector2D is marked #[inline] but it doesn't seem like it needs to be since it is generic in the unit? Not sure if that has any effect there? I left the others without #[inline] but I can change it if you'd like.

@nical
Copy link
Collaborator

nical commented Nov 16, 2019

Looks good to me, Thanks! Could you add a commit that bumps the version to 0.20.4 in Cargo.toml ?

@nical
nical approved these changes Nov 16, 2019
@kyren
Copy link
Contributor Author

kyren commented Nov 16, 2019

Looks good to me, Thanks! Could you add a commit that bumps the version to 0.20.4 in Cargo.toml ?

Done.

@nical
Copy link
Collaborator

nical commented Nov 16, 2019

Thanks! @bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented Nov 16, 2019

📌 Commit 79bbbeb has been approved by nical

@bors-servo
Copy link
Contributor

bors-servo commented Nov 16, 2019

Testing commit 79bbbeb with merge 2e751fb...

bors-servo added a commit that referenced this pull request Nov 16, 2019
Add `cast_unit` to the rest of the basic geometric types

This is much more convenient than `X::from_untyped(x.to_untyped())`, and previously only existed on `Vector2D`.

The implementation on `Vector2D` is marked `#[inline]` but it doesn't seem like it needs to be since it is generic in the unit?  Not sure if that has any effect there?  I left the others without `#[inline]` but I can change it if you'd like.
@bors-servo
Copy link
Contributor

bors-servo commented Nov 16, 2019

☀️ Test successful - checks-travis
Approved by: nical
Pushing 2e751fb to master...

@bors-servo bors-servo merged commit 79bbbeb into servo:master Nov 16, 2019
2 checks passed
2 checks passed
Travis CI - Pull Request Build Passed
Details
homu Test successful
Details
@nical
Copy link
Collaborator

nical commented Nov 16, 2019

Up on crates.io https://crates.io/crates/euclid/0.20.4

@kyren
Copy link
Contributor Author

kyren commented Nov 16, 2019

Thanks so much for doing that so fast 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.