-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[gardening][Measurement] Move operators into types #1349
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
[gardening][Measurement] Move operators into types #1349
Conversation
@swift-ci Please test |
let lhsValueInTermsOfBase = lhs.unit.converter.baseUnitValue(fromValue: lhs.value) | ||
let rhsValueInTermsOfBase = rhs.unit.converter.baseUnitValue(fromValue: rhs.value) | ||
return Measurement(value: lhsValueInTermsOfBase - rhsValueInTermsOfBase, unit: type(of: lhs.unit).baseUnit()) | ||
extension Measurement where UnitType : Dimension { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that having a lot of new extension
s is ideal. Could we move this inside the existing extension on line 47?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every single method seems to be in its own extension although some are using a conditional conformance so this is consistent. However maybe a followup PR could merge them so there are only two extensions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every single method seems to be in its own extension although some are using a conditional conformance so this is consistent. However maybe a followup PR could merge them so there are only two extensions.
Yep I'm going to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK as long as this PR isn't the end then 👍
@swift-ci please test and merge |
Thanks @ianpartridge and @spevans! |
I believe this code is also shared with the overlay. |
https://github.com/apple/swift-corelibs-foundation/pull/1349/files?w=1