Skip to content

Commit

Permalink
feat: Add missing 'From'
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jul 9, 2021
1 parent 84f0d37 commit 69866d4
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 69866d4

Please sign in to comment.