rushmorem / publicsuffix

An implementation of Mozilla's Public Suffix List in Rust
MIT License
96 stars 17 forks source link

Replace dependencies with local impls #32

Closed algesten closed 3 years ago

algesten commented 4 years ago

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 and regex could quite easily be replaced by local implementations.

This PR is broken into two commits:

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.

├── publicsuffix v1.5.4
│   ├── error-chain v0.12.2
│   │   [build-dependencies]
│   │   └── version_check v0.9.1
│   ├── idna v0.2.0
│   │   ├── matches v0.1.8
│   │   ├── unicode-bidi v0.3.4
│   │   │   └── matches v0.1.8 (*)
│   │   └── unicode-normalization v0.1.12
│   │       └── smallvec v1.4.0
│   ├── lazy_static v1.4.0
│   ├── regex v1.3.7
│   │   └── regex-syntax v0.6.17
│   └── url v2.1.1
│       ├── idna v0.2.0 (*)
│       ├── matches v0.1.8 (*)
│       └── percent-encoding v2.1.0 (*)
JordiPolo commented 4 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 :)

coolreader18 commented 3 years ago

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.