Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
Implement ToSymbol for InternedString
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Nov 23, 2016
1 parent 0b2b693 commit 14637ce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/symbol.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use syntax::ast;
use syntax::symbol::Symbol;
use syntax::symbol::{InternedString, Symbol};

//////////////////////////////////////////////////////////////////////////////

Expand All @@ -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()
Expand Down

0 comments on commit 14637ce

Please sign in to comment.