feat(types/try_from_impl): Add a trixy::String from &str impl

This makes it more convenient to use the api.
This commit is contained in:
Benedikt Peetz 2024-03-27 22:15:59 +01:00
parent db5cd1a29b
commit c69c00e1e9
Signed by: bpeetz
GPG Key ID: A5E94010C3A642AD
1 changed files with 6 additions and 0 deletions

View File

@ -33,6 +33,12 @@ impl From<std::string::String> for String {
String(c_char)
}
}
/// Plainly here for convenience
impl From<&str> for String {
fn from(value: &str) -> Self {
value.to_owned().into()
}
}
impl TryFrom<String> for std::string::String {
type Error = crate::types::error::TypeConversionError;