Make Coordinates optional for D01, D02, D03.#47
Merged
Conversation
Since `Operation` specifies an `Option<CoordinateOffset>` it is inconsistent to allow both of these states:
a) `Operation::Interpolate { _, Some(CoordinateOffset { x: None, y: None })}`
b) `Operation::Interpolate { _, None },
* If a viewer encounters the first state, it should generate a warning.
* A parser should never generate the first state (a) to begin with and generate (b) instead.
To be consistent, it's now invalid for both Coordinate and CoordinateOffset to have neither X nor Y. Instead, `None` should be used for the `Coordinate` or `CoordinateOffset` instance itself.
* this answers the long-standing 'should we catch this' question, the answer is YES.
Contributor
Author
|
this PR removes the last outstanding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since
Operationspecifies anOption<CoordinateOffset>it is inconsistent to allow both of these states:a)
Operation::Interpolate { _, Some(CoordinateOffset { x: None, y: None })}b)
Operation::Interpolate { _, None },To be consistent, it's now invalid for both Coordinate and CoordinateOffset to have neither X nor Y. Instead,
Noneshould be used for theCoordinateorCoordinateOffsetinstance itself.