Skip to content

Commit

Permalink
fix: Package default() & new() features
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Perkowski <[email protected]>
  • Loading branch information
adamperkowski committed Nov 27, 2024
1 parent ca96da8 commit 779c1ef
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,18 @@ impl Package {
) -> error::Result<Self> {
let mut package = Package::default();

match source.as_ref() {
match source.as_str() {
#[cfg(feature = "aur")]
"aur" => {
package.aur = target;
Ok(())
}
#[cfg(feature = "github")]
"github" => {
package.github = target;
Ok(())
}
#[cfg(feature = "gitlab")]
"gitlab" => {
package.gitlab = target;
Ok(())
Expand All @@ -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(),
Expand Down

0 comments on commit 779c1ef

Please sign in to comment.