diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2017-08-31 23:23:52 +0300 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2017-08-31 23:23:52 +0300 |
| commit | 9988e798c0d2870f91452e8514734c9e5250311d (patch) | |
| tree | 1ebe42651a66e1e65313a2fd4dddf67c8c067975 | |
| parent | 890c87b643264120dc1064ed73df6def974e02fc (diff) | |
| download | rust-9988e798c0d2870f91452e8514734c9e5250311d.tar.gz rust-9988e798c0d2870f91452e8514734c9e5250311d.zip | |
Implement From<&str> for Symbol.
| -rw-r--r-- | src/libsyntax_pos/symbol.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsyntax_pos/symbol.rs b/src/libsyntax_pos/symbol.rs index e49f1f28e5f..4d3db15ef29 100644 --- a/src/libsyntax_pos/symbol.rs +++ b/src/libsyntax_pos/symbol.rs @@ -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) |
