Implement From<&str> for Symbol.
This commit is contained in:
parent
890c87b643
commit
9988e798c0
1 changed files with 6 additions and 0 deletions
|
@ -115,6 +115,12 @@ impl Symbol {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a str> for Symbol {
|
||||
fn from(string: &'a str) -> Symbol {
|
||||
Symbol::intern(string)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Symbol {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{}({})", self, self.0)
|
||||
|
|
Loading…
Reference in a new issue