Skip to content

Commit

Permalink
Refactor impl From<String> for Require
Browse files Browse the repository at this point in the history
Co-authored-by: Manuel Fuchs <manuel.fuchs@salesforce.com>
  • Loading branch information
hone and Malax authored Mar 10, 2022
1 parent 6744448 commit 887a754
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions libcnb-data/src/build_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,14 @@ impl Require {
}
}

impl From<String> for Require {
fn from(s: String) -> Require {
Require::new(s)
impl<S: Into<String>> From<S> for Require {
fn from(s: S) -> Self {
Require {
name: s.into(),
metadata: Default::default(),
}
}
}

impl From<&str> for Require {
fn from(s: &str) -> Require {
Require::new(s)
}
}

#[cfg(test)]
Expand Down

0 comments on commit 887a754

Please sign in to comment.