diff options
author | Ellie Huxtable <ellie@elliehuxtable.com> | 2021-05-10 22:16:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-10 21:16:07 +0000 |
commit | fe4578747403e96f75bc495a65724e515199490a (patch) | |
tree | c7020e60528c39b39203b16b03fc6e27882f245e /atuin-common | |
parent | d3059af815130f102dd97cb1d1e5030920754105 (diff) |
Re-add macro_use to atuin-common (#107)
* Re-add macro_use to atuin-common
When build as a dependency, the macro is available from another crate.
When you try to build common by itself, the macro is not found. Magic,
huh?
* chore: remove unneeded use - clippy is confused
Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
Diffstat (limited to 'atuin-common')
-rw-r--r-- | atuin-common/src/api.rs | 2 | ||||
-rw-r--r-- | atuin-common/src/lib.rs | 3 | ||||
-rw-r--r-- | atuin-common/src/utils.rs | 4 |
3 files changed, 8 insertions, 1 deletions
diff --git a/atuin-common/src/api.rs b/atuin-common/src/api.rs index aaf8f6c5..862759ba 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 e76a7abb..77cd644d 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 f150d38d..7fe0c300 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"); } } |