Skip to content

Commit 9988e79

Browse files
committed
Implement From<&str> for Symbol.
1 parent 890c87b commit 9988e79

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libsyntax_pos/symbol.rs

+6
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ impl Symbol {
115115
}
116116
}
117117

118+
impl<'a> From<&'a str> for Symbol {
119+
fn from(string: &'a str) -> Symbol {
120+
Symbol::intern(string)
121+
}
122+
}
123+
118124
impl fmt::Debug for Symbol {
119125
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
120126
write!(f, "{}({})", self, self.0)

0 commit comments

Comments
 (0)