HenningHolmDE / hcloud-rust

Unofficial Rust crate for accessing the Hetzner Cloud API
Other
66 stars 6 forks source link

Remove hard dependency on `reqwest/default-tls` #24

Closed DanielSidhion closed 1 month ago

DanielSidhion commented 1 month ago

The reqwest dependency was specified with all its default features, which includes default-tls. Even by using hcloud-cloud with its rustls-tls feature wouldn't remove the default-tls dependency.

[dependencies]
hcloud = { version = "0.20", default-features = false, features = ["rustls-tls"] }
$ cargo tree -e features -i reqwest
reqwest v0.12.8
├── reqwest feature "__rustls"
│   └── reqwest feature "rustls-tls-webpki-roots"
│       └── reqwest feature "rustls-tls"
│           └── hcloud feature "rustls-tls"
│               └── ...
...
├── reqwest feature "__tls"
│   ├── reqwest feature "__rustls" (*)
│   └── reqwest feature "default-tls"                        <- default-tls included here
│       └── reqwest feature "default"
│           └── hcloud v0.20.0
│               └── hcloud feature "rustls-tls" (*)          <- hcloud with rustls-tls here
...

This PR removes the default features of reqwest to avoid the default-tls feature. When doing this, we lose some of the other default features, so this PR also lists those features specifically to avoid losing them.

HenningHolmDE commented 1 month ago

@DanielSidhion Thank you for providing the improvement. Do you need this to be released soon for your use case of the crate?

DanielSidhion commented 1 month ago

@HenningHolmDE no worries, thanks for the review! I'm currently using a patch on my Cargo.toml, so no big rush with a new release. I'll subscribe to new releases of hcloud-rust so I can clean up the patch in the future.

HenningHolmDE commented 3 weeks ago

@DanielSidhion I just released v0.20.1 patching this, sorry for the delay. You should be able to get rid of you patch, now.

DanielSidhion commented 3 weeks ago

No worries, thank you! Just updated things on my side to remove the patch :)