From 14637cee780248c6196947e6cab6ddd6194947b4 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 23 Nov 2016 11:50:58 -0800 Subject: [PATCH] Implement ToSymbol for InternedString --- src/symbol.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/symbol.rs b/src/symbol.rs index a93339180..d30cd15c8 100644 --- a/src/symbol.rs +++ b/src/symbol.rs @@ -1,5 +1,5 @@ use syntax::ast; -use syntax::symbol::Symbol; +use syntax::symbol::{InternedString, Symbol}; ////////////////////////////////////////////////////////////////////////////// @@ -25,6 +25,12 @@ impl ToSymbol for ast::Ident { } } +impl ToSymbol for InternedString { + fn to_symbol(&self) -> Symbol { + Symbol::intern(self) + } +} + impl<'a, T> ToSymbol for &'a T where T: ToSymbol { fn to_symbol(&self) -> Symbol { (**self).to_symbol()