Closed algesten closed 3 years ago
FWIW in my hobby project I have ~200 dependencies total and this is the only one bringing error-chain into the mix, so I'd really welcome this change :)
Is there any update on this? I can also attest that it would be nice to get rid of regex
, as this crate (as a transitive dependency of reqwest
) is the only one that depends on it.
Hi! I'm looking at using publicsuffix in hreq. In hreq I want to minimize the number of dependencies and after some investigation into dependencies that are pulled in for one crate only, I found that publicsuffix was a good candidate.
Looking at publicsuffix dependencies, I figured both
error-chain
andregex
could quite easily be replaced by local implementations.This PR is broken into two commits:
regex
andlazy_static
and uses a simple iterator approach to validate domain names and email local parts.error-chain
by making a hand written impl ofError
.The second commit might be controversial cause it changes the surface area API of the
Error
type – i.e. breaking change. Happy to discuss/work the commits separately or as one.