servo / euclid

Geometry primitives (basic linear algebra) for Rust
Other
462 stars 102 forks source link

(breaking change) Don't implement Floor, Ceil and Round on integer types. #449

Closed jrmuizel closed 4 years ago

jrmuizel commented 4 years ago

I can't see a reason to have it.

nical commented 4 years ago

@bors-servo r+

bors-servo commented 4 years ago

:pushpin: Commit 609955f has been approved by nical

bors-servo commented 4 years ago

:hourglass: Testing commit 609955f6b30ac90324710fa403d736d0d568194f with merge 508cbce640015956cddcb8faac0d8a58600827eb...

bors-servo commented 4 years ago

:sunny: Test successful - checks-travis Approved by: nical Pushing 508cbce640015956cddcb8faac0d8a58600827eb to master...

kyren commented 4 years ago

I actually have a use case for exactly this and discovered this issue when fixing my build after upgrading to euclid 0.22. Having these implementations allows me to treat f32, i32 the same in a generic context where getting the i32 bounding box is important.

It's not critical for me because I can work around the problem basically by making my own trait for it with a round_out method that is a no-op for integers, but it's slightly annoying.

If it would be welcome, I'd make a PR to add this back, but I understand if it's just not an API surface you want in the future.

nical commented 4 years ago

I'm fine with adding it back.

kyren commented 4 years ago

I ended up needing it twice, so I figure that passes the bar of being useful for me at least, so I made a PR: https://github.com/servo/euclid/pull/464