diff --git a/atuin-common/src/api.rs b/atuin-common/src/api.rs index aaf8f6c..862759b 100644 --- a/atuin-common/src/api.rs +++ b/atuin-common/src/api.rs @@ -1,7 +1,7 @@ use std::{borrow::Cow, convert::Infallible}; use chrono::Utc; -use serde::{Deserialize, Serialize}; +use serde::Serialize; use warp::{reply::Response, Reply}; #[derive(Debug, Serialize, Deserialize)] diff --git a/atuin-common/src/lib.rs b/atuin-common/src/lib.rs index e76a7ab..77cd644 100644 --- a/atuin-common/src/lib.rs +++ b/atuin-common/src/lib.rs @@ -1,4 +1,7 @@ #![forbid(unsafe_code)] +#[macro_use] +extern crate serde_derive; + pub mod api; pub mod utils; diff --git a/atuin-common/src/utils.rs b/atuin-common/src/utils.rs index f150d38..7fe0c30 100644 --- a/atuin-common/src/utils.rs +++ b/atuin-common/src/utils.rs @@ -64,6 +64,7 @@ mod tests { config_dir(), PathBuf::from("/home/user/custom_config/atuin") ); + env::remove_var("XDG_CONFIG_HOME"); } #[test] @@ -71,6 +72,7 @@ mod tests { env::set_var("HOME", "/home/user"); env::remove_var("XDG_CONFIG_HOME"); assert_eq!(config_dir(), PathBuf::from("/home/user/.config/atuin")); + env::remove_var("HOME"); } #[test] @@ -78,6 +80,7 @@ mod tests { env::remove_var("HOME"); env::set_var("XDG_DATA_HOME", "/home/user/custom_data"); assert_eq!(data_dir(), PathBuf::from("/home/user/custom_data/atuin")); + env::remove_var("XDG_DATA_HOME"); } #[test] @@ -85,5 +88,6 @@ mod tests { env::set_var("HOME", "/home/user"); env::remove_var("XDG_DATA_HOME"); assert_eq!(data_dir(), PathBuf::from("/home/user/.local/share/atuin")); + env::remove_var("HOME"); } }