code refactor
Some checks failed
CI / Check / Test (push) Has been cancelled

Reviewed-on: #26
This commit was merged in pull request #26.
This commit is contained in:
2026-10-26 09:36:23 +00:00
parent 2ce7db12c2
commit 017b58d6fa
804 changed files with 33423 additions and 28955 deletions

View File

@@ -0,0 +1,23 @@
use std::sync::Once;
pub fn install_crypto_provider() {
static INSTALL: Once = Once::new();
INSTALL.call_once(|| {
let _ = rustls::crypto::ring::default_provider().install_default();
});
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn https_client_builds_after_install() {
install_crypto_provider();
install_crypto_provider();
reqwest::Client::builder()
.build()
.expect("reqwest client builds");
assert!(rustls::crypto::CryptoProvider::get_default().is_some());
}
}