(&self)
| 17 | } |
| 18 | |
| 19 | pub fn to_local(&self) -> Ident { |
| 20 | let unraw = self.0.unraw(); |
| 21 | let repr = unraw.to_string(); |
| 22 | if syn::parse_str::<Ident>(&repr).is_err() { |
| 23 | if let "_" | "super" | "self" | "Self" | "crate" = repr.as_str() { |
| 24 | // Some identifiers are never allowed to appear as raw, like r#self and r#_. |
| 25 | } else { |
| 26 | return Ident::new_raw(&repr, Span::call_site()); |
| 27 | } |
| 28 | } |
| 29 | unraw |
| 30 | } |
| 31 | |
| 32 | pub fn set_span(&mut self, span: Span) { |
| 33 | self.0.set_span(span); |
no outgoing calls
no test coverage detected