style: move with_tls_versions to top

This commit is contained in:
DarkCat09 2024-08-08 15:29:08 +04:00
parent 148708ee68
commit e14efd6091
Signed by: DarkCat09
GPG key ID: 0A26CD5B3345D6E3

View file

@ -86,6 +86,16 @@ impl ClientBuilder {
Client::from(tls_config) Client::from(tls_config)
} }
/// Limit the supported TLS versions list to the specified ones.
/// Default is [`rustls::DEFAULT_VERSIONS`].
pub fn with_tls_versions(
mut self,
versions: &'static [&'static SupportedProtocolVersion],
) -> Self {
self.tls_versions = Some(versions);
self
}
/// Include webpki trust anchors. /// Include webpki trust anchors.
/// Not recommended (useless) as most Gemini capsules use self-signed /// Not recommended (useless) as most Gemini capsules use self-signed
/// TLS certs and properly configured TOFU policy is enough. /// TLS certs and properly configured TOFU policy is enough.
@ -128,14 +138,4 @@ impl ClientBuilder {
self.custom_verifier = Some(Arc::new(custom_verifier)); self.custom_verifier = Some(Arc::new(custom_verifier));
self self
} }
/// Limit the supported TLS versions list to the specified ones.
/// Default is [`rustls::DEFAULT_VERSIONS`].
pub fn with_tls_versions(
mut self,
versions: &'static [&'static SupportedProtocolVersion],
) -> Self {
self.tls_versions = Some(versions);
self
}
} }