Skip to content

Commit

Permalink
Drop Targ generics
Browse files Browse the repository at this point in the history
Again a breaking change but was broken before
  • Loading branch information
Morganamilo committed Nov 27, 2023
1 parent d5ff5e3 commit 144ced6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions alpm-utils/src/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct Target {

impl AsTarg for Target {
fn as_targ(&self) -> Targ {
Targ::new(self.repo.as_ref(), &self.pkg)
Targ::new(self.repo.as_deref(), &self.pkg)
}
}

Expand All @@ -51,11 +51,8 @@ pub struct Targ<'a> {

impl<'a> Targ<'a> {
/// Create a new Targ.
pub fn new<S: AsRef<str>>(repo: Option<S>, pkg: S) -> Targ<'a> {
Targ {
repo: repo.map(AsRef::as_ref),
pkg: pkg.as_ref(),
}
pub fn new(repo: Option<&'a str>, pkg: &'a str) -> Targ<'a> {
Targ { repo, pkg }
}
}

Expand Down

0 comments on commit 144ced6

Please sign in to comment.