From 7bc5f7d97a3457b3dae8f945028224a68e66fb44 Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Wed, 27 Nov 2024 20:05:40 +0100 Subject: [PATCH] fix: `Package` default() & new() features Signed-off-by: Adam Perkowski --- src/config.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index 0baff72..8fb9ea0 100644 --- a/src/config.rs +++ b/src/config.rs @@ -71,15 +71,18 @@ impl Package { ) -> error::Result { let mut package = Package::default(); - match source.as_ref() { + match &source { + #[cfg(feature = "aur")] "aur" => { package.aur = target; Ok(()) } + #[cfg(feature = "github")] "github" => { package.github = target; Ok(()) } + #[cfg(feature = "gitlab")] "gitlab" => { package.gitlab = target; Ok(()) @@ -98,8 +101,11 @@ impl Package { Package { source: String::new(), host: String::new(), + #[cfg(feature = "aur")] aur: String::new(), + #[cfg(feature = "github")] github: String::new(), + #[cfg(feature = "gitlab")] gitlab: String::new(), use_max_tag: None, prefix: String::new(),