Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd support for Saturating add and subtract #168
Conversation
|
r? @glennw |
|
Looks good to me without that comment, thanks for doing this! And sorry it stayed here so long without a review :( |
| @@ -117,6 +117,18 @@ impl<U, T: Clone + SubAssign<T>> SubAssign for Length<T, U> { | |||
| } | |||
| } | |||
|
|
|||
| // Saturating length + length and length - length. | |||
| impl<U, T: Clone + Saturating> Saturating for Length<T, U> { | |||
| // type Output = Length<T, U>; | |||
This comment has been minimized.
This comment has been minimized.
|
@emilio np, thanks for taking the time to review :). I removed the commented out Output type... why is it not required/desired in this function but is throughout all the others in length.rs? |
|
It's not required because it's not part of the trait at https://github.com/rust-num/num/blob/master/traits/src/ops/saturating.rs. I don't think a @bors-servo r+ If it's urgent or you need it somewhere I can PR a version bump and publish it, otherwise it'll be published with the next version bump. Thanks a bunch! |
|
|
|
|
Add support for Saturating add and subtract Adds support for Length.saturating_add and saturating_sub for #103 Let me know if the intention is to support Saturating for other types also (happy to do separate branches). <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/euclid/168) <!-- Reviewable:end -->
absoludity commentedOct 31, 2016
•
edited by larsbergstrom
Adds support for Length.saturating_add and saturating_sub for #103
Let me know if the intention is to support Saturating for other types also (happy to do separate branches).
This change is