Skip to content

Commit

Permalink
feat(API): Support &String->Scalar
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jan 23, 2018
1 parent 1ca16f5 commit b87c983
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/value/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ impl From<String> for Scalar {
}
}

impl<'a> From<&'a String> for Scalar {
fn from(s: &String) -> Self {
Scalar { 0: ScalarEnum::Str(s.to_owned()) }
}
}

impl<'a> From<&'a str> for Scalar {
fn from(s: &str) -> Self {
Scalar { 0: ScalarEnum::Str(s.to_owned()) }
Expand Down

0 comments on commit b87c983

Please sign in to comment.