Skip to content

Commit

Permalink
Merge pull request #8 from epage/from
Browse files Browse the repository at this point in the history
feat: Add missing 'From'
  • Loading branch information
epage authored Jul 9, 2021
2 parents 84f0d37 + 69866d4 commit 580c9b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
<!-- next-header -->
## [Unreleased] - ReleaseDate

#### Features

- Add missing `impl From<&String> for KString`

## [1.0.3] - 2021-07-08

#### Performance
Expand Down
8 changes: 7 additions & 1 deletion src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,16 @@ impl From<StdString> for KString {
}
}

impl<'s> From<&'s StdString> for KString {
#[inline]
fn from(other: &'s StdString) -> Self {
Self::from_ref(other)
}
}

impl From<BoxedStr> for KString {
#[inline]
fn from(other: BoxedStr) -> Self {
// Since the memory is already allocated, don't bother moving it into a FixedString
Self::from_boxed(other)
}
}
Expand Down

0 comments on commit 580c9b7

Please sign in to comment.