We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 07c78ef commit 16a33a9Copy full SHA for 16a33a9
1 file changed
src/convert.rs
@@ -1,5 +1,7 @@
1
use std::borrow::Borrow;
2
+use std::convert::Infallible;
3
use std::fmt;
4
+use std::str::FromStr;
5
use std::str::Utf8Error;
6
7
use crate::YarnBox;
@@ -209,6 +211,14 @@ impl From<YarnRef<'_, str>> for String {
209
211
}
210
212
213
214
+impl FromStr for YarnBox<'static, str> {
215
+ type Err = Infallible;
216
+
217
+ fn from_str(s: &str) -> Result<Self, Self::Err> {
218
+ Ok(Self::copy(s))
219
+ }
220
+}
221
222
// AsRef / Borrow
223
224
impl<Buf> AsRef<Buf> for YarnBox<'_, Buf>
0 commit comments