NLnetLabs / domain

A DNS library for Rust.
https://nlnetlabs.nl/projects/domain/about/
BSD 3-Clause "New" or "Revised" License
342 stars 58 forks source link

Move FoundSrvs::into_stream into feature "stream" #245

Closed WhyNotHugo closed 9 months ago

WhyNotHugo commented 9 months ago

This function (and only this function) depends on the futures create, which itself requires over a dozen other dependencies.

Move the function into its own feature, "stream". This allows enabling the "resolv" feature without the futures dependency tree, which substantially reduces unnecessary dependencies.

WhyNotHugo commented 9 months ago

For reference, this reduces the amount of dependencies by sixteen for me:

> cargo tree --prefix=none --features resolv | sort | uniq | wc -l
38

> cargo tree --prefix=none --features resolv,stream | sort | uniq | wc -l 
54
partim commented 9 months ago

Thank you for the PR!

Switching to futures-util without default features results in 41 dependencies (basically the three futures crates). I feel like this might be acceptable in exchange for not having another feature?

WhyNotHugo commented 9 months ago

Yeah, that sounds a lot better.

I tried removing features from futures, but didn’t realise I could just use that other one instead. I work on that and send a new PR.