(&self, f: &mut AstFormatter<W>)
| 380 | /// Quotation is forced when printing in Stable mode. |
| 381 | impl AstDisplay for Ident { |
| 382 | fn fmt<W: fmt::Write>(&self, f: &mut AstFormatter<W>) { |
| 383 | if self.can_be_printed_bare() && !f.stable() { |
| 384 | f.write_str(&self.0); |
| 385 | } else { |
| 386 | f.write_str("\""); |
| 387 | for ch in self.0.chars() { |
| 388 | // Double up on double-quotes. |
| 389 | if ch == '"' { |
| 390 | f.write_str("\""); |
| 391 | } |
| 392 | f.write_str(ch); |
| 393 | } |
| 394 | f.write_str("\""); |
| 395 | } |
| 396 | } |
| 397 | } |
| 398 | impl_display!(Ident); |
| 399 |
nothing calls this directly
no test coverage detected