Skip to content

make with_provider_and_* take Arc<CryptoProvider> instead of CryptoProvider #282

@cpu

Description

@cpu

Suggested by Adrian in discord:

Hey there, seems like hyper-rustls' with_provider_and_* methods take a CryptoProvider, meaning that it's impossible to call CryptoProvider::get_default() in a library and pass that as the argument (since getting an owned value out of the Arc is not really possible). I think the API should take an Arc, just like rustls' ClientConfig::with_provider, which it calls internally (by creating an Arc via .into()).

Ctz mentioned impossible might be an overstatement (e.g. due to Arc::unwrap_or_clone()) but in general there was agreement that the API should be changed to take an Arc.

We should consider making this change alongside future breaking API changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    next-major-releasebreaking changes that should happen in the next major release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions