Skip to content

Commit ff1665e

Browse files
authored
Swap From<&'static str> with From<&str> for IString (#67)
Fixes #56
1 parent f94a078 commit ff1665e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/string.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ impl fmt::Display for IString {
6969
}
7070
}
7171

72-
impl From<&'static str> for IString {
73-
fn from(s: &'static str) -> IString {
74-
IString::Static(s)
72+
impl From<&str> for IString {
73+
fn from(s: &str) -> IString {
74+
IString::Rc(Rc::from(s))
7575
}
7676
}
7777

@@ -193,7 +193,7 @@ impl std::borrow::Borrow<str> for IString {
193193
impl FromStr for IString {
194194
type Err = std::convert::Infallible;
195195
fn from_str(value: &str) -> Result<Self, Self::Err> {
196-
Ok(IString::from(String::from(value)))
196+
Ok(IString::from(value))
197197
}
198198
}
199199

0 commit comments

Comments
 (0)