rust-html2text icon indicating copy to clipboard operation
rust-html2text copied to clipboard

Parse misuse resistance

Open sftse opened this issue 1 year ago • 2 comments

The parse function is potentially easy to misuse. Also, some unrelated refactors.

sftse avatar Dec 12 '24 14:12 sftse

Hi, Thanks for another MR! Could you please separate "unrelated refactors" and clippy changes to separate MRs if possible? I find it much harder to review changes with the other non-functional changes mixed in (the separate commits for parts of the change definitely help, but it's too easy to miss things in the whole diff).

jugglerchris avatar Dec 15 '24 17:12 jugglerchris

If #192 gets accepted, we'll rebase on main. What remains is the last commit, which originally suggested to replace pub fn parse with the method pub fn do_parse. We looked at this part of the code in preparation to an upcoming PR in which we'll request additional internal configuration to be exposed, either configuration of RenderTree or exposing the Renderer trait, but probably not both.

On second thought, we're not so sure anymore we'll want to configure RenderTree over using the Renderer trait, so we're pausing these suggestions until we have to cross that bridge. These changes are clearly not critical, since there is probably nobody using these functions.

sftse avatar Dec 16 '24 11:12 sftse