`trust-dns-optional` crate feature
This feature allows one to enable use of the trust-dns resolver, while
not setting it as the default.
This is useful in large monorepo codebases where trust-dns is only
desirable in a small number of callsites, but feature sets are global.
@seanmonstar is there anything blocking this that I can resolve?
@seanmonstar can you please review this? Thanks!
Oh, I see what you're wanting to do... Hm. I'd say the best solution would be to fix reqwest so that enabling the feature doesn't automatically use it on all clients. "Optional" features in this way seem very different than the normal usage.
Or, if we made the resolver completely pluggable, than we wouldn't need special knowledge of trust-dns...
I'd say the best solution would be to fix reqwest so that enabling the feature doesn't automatically use it on all clients
That was another option that I considered, but it is a breaking change of behavior for existing users. IMO it does make sense and I'd be happy to make that change here.
My only other idea is gross: a separate feature that would set the default to trustdns that is enabled as a default feature, but only takes effect if trustdns is enabled, followed by additional feature(s) to explicitly set the default resolver. That way if a user enables the trustdns feature, then by default they get that as the default client resolver unless they explicitly turn off default-features...