html-query
html-query copied to clipboard
Refactor into a library
I'd like to use hq in one of my personal rust projects, but I don't want to use the binary.
Could we refactor hq into a library and make the binary use that lib instead?
That's a great idea - I don't have time to work on it right now, but when I next get round to making changes to this project I will give it a go.
Can you describe what kind of interface you'd like for the library?
I'd love to have something like a pub fn hq(query: impl ToString, text: impl ToString) -> Result<serde_json::Value, HqError>
I was having more thoughts about this and figured I'd also love to have pub fn validate_query(query: impl ToString) -> Result<(), HqError>
Agree, would love to see this as a library.
Yep! This is my next project to show some love to. I’m going to be making this into a library, changing a few things around and making it a bit more easy to use.