aboutsummaryrefslogtreecommitdiffstats
path: root/crates/common/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/common/src')
-rw-r--r--crates/common/src/lib.rs1
-rw-r--r--crates/common/src/shell.rs4
-rw-r--r--crates/common/src/tls.rs15
3 files changed, 3 insertions, 17 deletions
diff --git a/crates/common/src/lib.rs b/crates/common/src/lib.rs
index d886520d..8bd18456 100644
--- a/crates/common/src/lib.rs
+++ b/crates/common/src/lib.rs
@@ -54,5 +54,4 @@ macro_rules! new_uuid {
pub mod api;
pub mod record;
pub mod shell;
-pub mod tls;
pub mod utils;
diff --git a/crates/common/src/shell.rs b/crates/common/src/shell.rs
index 8bab806a..a57250e2 100644
--- a/crates/common/src/shell.rs
+++ b/crates/common/src/shell.rs
@@ -1,4 +1,4 @@
-#[derive(PartialEq)]
+#[derive(PartialEq, Clone, Copy, Debug)]
pub enum Shell {
Sh,
Bash,
@@ -30,12 +30,14 @@ impl std::fmt::Display for Shell {
}
impl Shell {
+ #[must_use]
pub fn from_env() -> Self {
std::env::var("ATUIN_SHELL").map_or(Self::Unknown, |shell| {
Self::from_string(shell.trim().to_lowercase().as_str())
})
}
+ #[must_use]
pub fn from_string(name: &str) -> Self {
match name {
"bash" => Self::Bash,
diff --git a/crates/common/src/tls.rs b/crates/common/src/tls.rs
deleted file mode 100644
index e8c840e0..00000000
--- a/crates/common/src/tls.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-use std::sync::Once;
-
-static INIT: Once = Once::new();
-
-/// Ensure the rustls crypto provider (ring) is installed.
-///
-/// Must be called before creating any reqwest clients. Safe to call
-/// multiple times — only the first call installs the provider.
-pub fn ensure_crypto_provider() {
- INIT.call_once(|| {
- rustls::crypto::ring::default_provider()
- .install_default()
- .expect("Failed to install rustls crypto provider");
- });
-}