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

Replace panic with error return in BezPath::from_svg #329

Merged
merged 2 commits into from
Jan 29, 2024
Merged

Replace panic with error return in BezPath::from_svg #329

merged 2 commits into from
Jan 29, 2024

Conversation

platlas
Copy link
Collaborator

@platlas platlas commented Jan 16, 2024

As pointed out in #303 (comment) BezPath::from_svg does not handle case when SVG path does not start with initial point. This PR makes the BezPath::from_svg return an error for this case.

@platlas
Copy link
Collaborator Author

platlas commented Jan 16, 2024

It is failing on clippy lints: unused_enumerate_index (that was added to latest version) and items_after_test_module. But I need to find out why clippy have not warned me on my local machine even if I use latest version.

Copy link
Contributor

@raphlinus raphlinus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, panicking is not a good thing to do for simply invalid input. Thanks!

@platlas platlas merged commit 6ea9f53 into linebender:main Jan 29, 2024
14 checks passed
@platlas platlas deleted the from_svg_panic branch January 29, 2024 22:20
DJMcNab added a commit to DJMcNab/kurbo that referenced this pull request Feb 14, 2024
linebender#329 was a breaking change
To avoid a similar situation in future, mark the offending enum
`#[non_exhaustive]`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants