(&self, item: &ExprFString, f: &mut PyFormatter)
| 15 | |
| 16 | impl FormatNodeRule<ExprFString> for FormatExprFString { |
| 17 | fn fmt_fields(&self, item: &ExprFString, f: &mut PyFormatter) -> FormatResult<()> { |
| 18 | if let Some(f_string) = item.as_single_part_fstring() { |
| 19 | f_string.format().fmt(f) |
| 20 | } else { |
| 21 | // Always join fstrings that aren't parenthesized and thus, are always on a single line. |
| 22 | if !f.context().node_level().is_parenthesized() { |
| 23 | if let Some(format_flat) = |
| 24 | FormatImplicitConcatenatedStringFlat::new(item.into(), f.context()) |
| 25 | { |
| 26 | return format_flat.fmt(f); |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | in_parentheses_only_group(&FormatImplicitConcatenatedString::new(item)).fmt(f) |
| 31 | } |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | impl NeedsParentheses for ExprFString { |
nothing calls this directly
no test coverage detected