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

fix: prevent panic when parsing a URL with no path #55

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

CardboardTurkey
Copy link

This PR adds 3 new commits:

chore: sate clippy

Fix clippy lints

fix: prevent panic when parsing a URL with no path

Prior to this change parse would panic at src/lib.rs:203:29 with
index out of bounds: the len is 0 but the index is 0 if given an input
like "git:".

feat: improve error handling

This removes a seemingly redundant and not very illuminating error
variant. It also ensures that the error message from the Url crate is
displayed when displaying UrlParseError.

@CardboardTurkey
Copy link
Author

Happy to make changes if I got anything wrong!

Prior to this change `parse` would panic at `src/lib.rs:203:29` with
`index out of bounds: the len is 0 but the index is 0` if given an input
like "git:".
This removes a seemingly redundant and not very illuminating error
variant. It also ensures that the error message from the `Url` crate is
displayed when displaying `UrlParseError`.
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.

1 participant