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

remove JsonPathInst, instead move find functionality to JsonPath. #68

Merged
merged 2 commits into from
Jul 12, 2024

Conversation

xMAC94x
Copy link
Contributor

@xMAC94x xMAC94x commented Jul 8, 2024

See #59
This PR has no further performance improvements like the other ones.
However it tries to simplify the usage of the crate for others.
That is done by getting rid of the JsonPathInst which was basically just a JsonPath and moving the independend find functions (3 independent and one in the JsonPathInst) all directly to the JsonPath.
Additionally the internal macros which where used for testing are no longer exported (i keep the jp_v and path one because I though those might make sense externally, please correct me here if others are used too).

This makes the docs page thinner, and focuses users more towards the common usecase:
image

Most diff is just moving the code, I found it hard to find the right spot for the JsonPath as its a result of the parser but also defines how stuff is searched and heavily relies on the path. I just now chosed a own file, though not 100% happy with it either.

Oh I could get rid of the vec_init_then_push clippy warnings in the macros, shouldn't have a big impact though.

no longer export all macros, add comments to the remaining ones.
Implement `FromStr` and `TryFrom<&str` for JsonPath (as the internet is not sure which is better)
fix various clippy things.
src/parser/macros.rs Outdated Show resolved Hide resolved
src/parser/macros.rs Outdated Show resolved Hide resolved
src/parser/macros.rs Outdated Show resolved Hide resolved
src/parser/macros.rs Outdated Show resolved Hide resolved
Copy link
Owner

@besok besok left a comment

Choose a reason for hiding this comment

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

I left a couple of comments, apart of it looks good to me.

@xMAC94x
Copy link
Contributor Author

xMAC94x commented Jul 12, 2024

Hi @besok I pushed another commit and adjusted the macro exports :)

@besok besok merged commit 82b6d90 into besok:main Jul 12, 2024
5 checks passed
@besok
Copy link
Owner

besok commented Jul 12, 2024

Great! Thank you for the awesome PR

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