From 947cc4a2fa9853bdc30e87656848f521889c0268 Mon Sep 17 00:00:00 2001 From: OMGeeky Date: Mon, 18 Sep 2023 18:38:19 +0200 Subject: [PATCH] add missed nested config & prelude --- src/lib.rs | 12 +++++++++++- tests/test.rs | 3 +-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 45ce3dd..27ac641 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,9 @@ -use confique::Config; +use prelude::*; use serde::{Deserialize, Serialize}; +pub mod prelude { + pub use super::Conf; + pub use confique::Config; +} #[derive(Debug, Serialize, Deserialize, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Config)] pub struct Conf { @@ -52,6 +56,12 @@ pub struct Google { /// The project ID for the Google Cloud project #[config(default = "twitchbackup-1")] pub project_id: String, + + #[config(nested)] + pub youtube: Youtube, + + #[config(nested)] + pub bigquery: BigQuery, } #[derive(Debug, Serialize, Deserialize, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Config)] diff --git a/tests/test.rs b/tests/test.rs index d345bcc..fe1d090 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -1,7 +1,6 @@ #[cfg(test)] mod test { - use backup_config::*; - use confique::Config; + use backup_config::prelude::*; #[test] fn test_config() {