| 623 | } |
| 624 | |
| 625 | fn unparse_fstring(&mut self, value: &ast::FStringValue) -> fmt::Result { |
| 626 | self.p("f")?; |
| 627 | let body = fmt::from_fn(|f| { |
| 628 | value.iter().try_for_each(|part| match part { |
| 629 | ast::FStringPart::Literal(lit) => f.write_str(lit), |
| 630 | ast::FStringPart::FString(ast::FString { elements, .. }) => { |
| 631 | Unparser::new(f, self.source).unparse_fstring_body(elements) |
| 632 | } |
| 633 | }) |
| 634 | }) |
| 635 | .to_string(); |
| 636 | // .unparse_fstring_body(elements)); |
| 637 | UnicodeEscape::new_repr(body.as_str().as_ref()) |
| 638 | .str_repr() |
| 639 | .write(self.f) |
| 640 | } |
| 641 | |
| 642 | fn unparse_tstring(&mut self, value: &ast::TStringValue) -> fmt::Result { |
| 643 | self.p("t")?; |