]> git.proxmox.com Git - rustc.git/blob - src/vendor/syn-0.11.11/src/aster/ident.rs
New upstream version 1.27.1+dfsg1
[rustc.git] / src / vendor / syn-0.11.11 / src / aster / ident.rs
1 use Ident;
2
3 pub trait ToIdent {
4 fn to_ident(&self) -> Ident;
5 }
6
7 impl ToIdent for Ident {
8 fn to_ident(&self) -> Ident {
9 self.clone()
10 }
11 }
12
13 impl<'a> ToIdent for &'a str {
14 fn to_ident(&self) -> Ident {
15 (**self).into()
16 }
17 }
18
19 impl ToIdent for String {
20 fn to_ident(&self) -> Ident {
21 self.clone().into()
22 }
23 }
24
25 impl<'a, T> ToIdent for &'a T
26 where T: ToIdent
27 {
28 fn to_ident(&self) -> Ident {
29 (**self).to_ident()
30 }
31 }
32
33 impl<'a, T> ToIdent for &'a mut T
34 where T: ToIdent
35 {
36 fn to_ident(&self) -> Ident {
37 (**self).to_ident()
38 }
39 }