diff options
| author | Ellie Huxtable <ellie@atuin.sh> | 2025-03-19 12:44:20 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-19 12:44:20 +0000 |
| commit | 14ec768b4520d4fc34dbf24e663ea7db940c18b7 (patch) | |
| tree | a37db707ab8676cad5b3e6ca47af3f2997958906 /crates/atuin-client/src/import/zsh_histdb.rs | |
| parent | feat: Use readline binding for ctrl-a when it is not the prefix (#2626) (diff) | |
| download | atuin-14ec768b4520d4fc34dbf24e663ea7db940c18b7.zip | |
chore: migrate to rust 2024 (#2635)
* chore: upgrade to 2024 edition
* ugh unsafe
* format
* nixxxxxxxxxxx why
Diffstat (limited to 'crates/atuin-client/src/import/zsh_histdb.rs')
| -rw-r--r-- | crates/atuin-client/src/import/zsh_histdb.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/atuin-client/src/import/zsh_histdb.rs b/crates/atuin-client/src/import/zsh_histdb.rs index eb72baa3..cac85566 100644 --- a/crates/atuin-client/src/import/zsh_histdb.rs +++ b/crates/atuin-client/src/import/zsh_histdb.rs @@ -38,8 +38,8 @@ use std::path::{Path, PathBuf}; use async_trait::async_trait; use atuin_common::utils::uuid_v7; use directories::UserDirs; -use eyre::{eyre, Result}; -use sqlx::{sqlite::SqlitePool, Pool}; +use eyre::{Result, eyre}; +use sqlx::{Pool, sqlite::SqlitePool}; use time::PrimitiveDateTime; use super::Importer; @@ -178,10 +178,12 @@ mod test { use sqlx::sqlite::SqlitePoolOptions; use std::env; #[tokio::test(flavor = "multi_thread")] + #[allow(unsafe_code)] async fn test_env_vars() { let test_env_db = "nonstd-zsh-history.db"; let key = "HISTDB_FILE"; - env::set_var(key, test_env_db); + // TODO: Audit that the environment access only happens in single-threaded code. + unsafe { env::set_var(key, test_env_db) }; // test the env got set assert_eq!(env::var(key).unwrap(), test_env_db.to_string()); |
