diff --git a/byteyarn/src/convert.rs b/byteyarn/src/convert.rs index 6d33745..30b1836 100644 --- a/byteyarn/src/convert.rs +++ b/byteyarn/src/convert.rs @@ -1,5 +1,7 @@ use std::borrow::Borrow; +use std::convert::Infallible; use std::fmt; +use std::str::FromStr; use std::str::Utf8Error; use crate::YarnBox; @@ -224,6 +226,14 @@ impl From> for String { } } +impl FromStr for YarnBox<'static, str> { + type Err = Infallible; + + fn from_str(s: &str) -> Result { + Ok(Self::copy(s)) + } +} + // AsRef / Borrow impl AsRef for YarnBox<'_, Buf>