diff options
Diffstat (limited to 'crates/common')
| -rw-r--r-- | crates/common/Cargo.toml | 69 | ||||
| -rw-r--r-- | crates/common/src/lib.rs | 1 | ||||
| -rw-r--r-- | crates/common/src/shell.rs | 4 | ||||
| -rw-r--r-- | crates/common/src/tls.rs | 15 |
4 files changed, 3 insertions, 86 deletions
diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index 3d36429c..df978c03 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -12,87 +12,18 @@ homepage = { workspace = true } repository = { workspace = true } [dependencies] -async-trait = "0.1.58" -axum = "0.8" -base64 = "0.22" -clap = { version = "4.5.7", features = ["derive"] } -clap_complete = "4.5.8" -clap_complete_nushell = "4.5.4" -colored = "2.0.4" -config = { version = "0.15.8", default-features = false, features = ["toml"] } -crossterm = {version = "0.29.0", features = ["use-dev-tty", "serde"] } -crypto_secretbox = "0.1.1" -dashmap = "6.1.0" directories = "6.0.0" eyre = "0.6" -fs-err = "3.1" -fs4 = "0.13.1" -fuzzy-matcher = "0.3.7" -hyper-util = "0.1" -indicatif = "0.18.0" -interim = { version = "0.2.0", features = ["time_0_3"] } -itertools = "0.14.0" -lasso = { version = "0.7", features = ["multi-threaded"] } -log = "0.4" -metrics = "0.24" -metrics-exporter-prometheus = { version = "0.18", default-features = false } -minspan = "0.1.5" -norm = { version = "0.1.1", features = ["fzf-v2"] } -notify = "7" -prost = "0.14" -rand = { version = "0.8.5", features = ["std"] } -ratatui = "0.30.0" -regex = "1.10.5" -reqwest = { version = "0.13", features = ["json", "rustls-no-provider", "stream"], default-features = false } -rmp = { version = "0.8.14" } -runtime-format = "0.1.3" -rustix = { version = "1.1.4", features = ["process", "fs"] } -rustls = { version = "0.23", default-features = false, features = [ "ring", "std", "tls12", ] } -rusty_paserk = { version = "0.5.0", default-features = false, features = [ "v4", "serde", ] } -rusty_paseto = { version = "0.8.0", default-features = false } semver = "1.0.20" serde = { version = "1.0.202", features = ["derive"] } -serde_json = "1.0.119" -serde_regex = "1.1.0" -serde_with = "3.8.1" -shellexpand = "3" -sql-builder = "3" sqlx = { version = "0.8", features = ["runtime-tokio-rustls", "time", "postgres", "uuid", "sqlite", "regexp"] } -thiserror = "2" time = { version = "0.3.47", features = [ "serde-human-readable", "macros", "local-offset", "macros", "formatting", "parsing"] } -tokio = { version = "1", features = ["full"] } -tokio-stream = { version = "0.1.14", features = ["net"] } -toml_edit = "0.25.4" -tonic = "0.14" -tonic-prost = "0.14" -tower = "0.5" -tower-http = { version = "0.6", features = ["trace"] } -tracing = "0.1" -tracing-appender = "0.2" -tracing-subscriber = { version = "0.3", features = ["ansi", "fmt", "registry", "env-filter", "json"] } typed-builder = "0.18.2" -unicode-segmentation = "1.11.0" -unicode-width = "0.2" -url = "2.5.2" uuid = { version = "1.9", features = ["v4", "v7", "serde"] } -vt100 = "0.16" -whoami = "2.1.0" - -[target.'cfg(target_os = "linux")'.dependencies] -arboard = { version = "3.4", default-features = false, features = [ "wayland-data-control", ] } -listenfd = "1.0.1" - -[target.'cfg(unix)'.dependencies] -daemonize = "0.5.0" -portable-pty = "0.9" -signal-hook = "0.3" [dev-dependencies] -tokio = { version = "1", features = ["full"] } [build-dependencies] -protox = "0.9" -tonic-prost-build = "0.14" [package.metadata.docs.rs] all-features = true 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"); - }); -} |
