(&self, item: &FString, f: &mut PyFormatter)
| 14 | |
| 15 | impl FormatNodeRule<FString> for FormatFString { |
| 16 | fn fmt_fields(&self, item: &FString, f: &mut PyFormatter) -> FormatResult<()> { |
| 17 | let normalizer = StringNormalizer::from_context(f.context()); |
| 18 | |
| 19 | let string_kind = normalizer.choose_quotes(item.into()).flags(); |
| 20 | |
| 21 | let context = InterpolatedStringContext::new( |
| 22 | string_kind, |
| 23 | InterpolatedStringLayout::from_interpolated_string_elements( |
| 24 | &item.elements, |
| 25 | f.context().source(), |
| 26 | ), |
| 27 | ); |
| 28 | |
| 29 | // Starting prefix and quote |
| 30 | let quotes = StringQuotes::from(string_kind); |
| 31 | write!(f, [string_kind.prefix(), quotes])?; |
| 32 | |
| 33 | for element in &item.elements { |
| 34 | FormatInterpolatedStringElement::new(element, context).fmt(f)?; |
| 35 | } |
| 36 | |
| 37 | // Ending quote |
| 38 | quotes.fmt(f) |
| 39 | } |
| 40 | } |
nothing calls this directly
no test coverage detected