Trim trailing end slashes (and fix formatting)#164
Merged
Conversation
JasoonS
commented
Aug 30, 2024
Comment on lines
+662
to
+664
| // Trim any trailing slashes from the URL | ||
| let trimmed_url = url.trim_end_matches('/').to_string(); | ||
| Ok(Self::HypersyncConfig(HypersyncConfig { endpoint_url: trimmed_url, is_client_decoder })) |
Contributor
Author
There was a problem hiding this comment.
These 3 lines are the only changes, Everything else is just formatting (indentation was wrong)
JasoonS
commented
Aug 30, 2024
| } | ||
|
|
||
| #[test] | ||
| fn test_hypersync_url_trailing_slash_trimming() { |
Contributor
Author
There was a problem hiding this comment.
Decided to add a small test for good measure
DZakh
requested changes
Sep 2, 2024
DZakh
left a comment
Member
There was a problem hiding this comment.
Nitpick: In this case I'd replace the validate_url function with the parse_url one, which would either return None, or Some with trimmed URL. Also, looks like we'd like to have the same logic for rpc URLs, not only hypersync
DZakh
reviewed
Sep 2, 2024
DZakh
left a comment
Member
There was a problem hiding this comment.
Since you're away, I've done the change myself. @JonoPrest Could you review, please
DZakh
approved these changes
Sep 2, 2024
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.
No description provided.