From f9dc628b77c3e363e3196b88c52c703ddc2685d3 Mon Sep 17 00:00:00 2001 From: Rene Klacan Date: Wed, 25 Sep 2024 17:44:15 +0200 Subject: [PATCH] Add rustls feature This allows library to be used without adding native-tls to dependencies with: ``` openai-api-rs = { version = "^5.0", default-features = false, features = ["rustls"] } ``` Default usage without features is unaffected. --- Cargo.toml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 4c29a18..c93360f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,9 +9,15 @@ repository = "https://github.com/dongri/openai-api-rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +default = ["default-tls"] +rustls = ["reqwest/rustls-tls"] +default-tls = ["reqwest/default-tls"] + [dependencies.reqwest] version = "0.12" -features = ["json", "multipart", "socks"] +default-features = false +features = ["charset", "http2", "json", "multipart", "socks"] [dependencies.tokio] version = "1"