Visit f-string elements, checking literals and recursing into interpolation expressions and format specs.
(&mut self, elements: &'a ast::InterpolatedStringElements)
| 260 | /// Visit f-string elements, checking literals and recursing into |
| 261 | /// interpolation expressions and format specs. |
| 262 | fn visit_fstring_elements(&mut self, elements: &'a ast::InterpolatedStringElements) { |
| 263 | for element in elements { |
| 264 | match element { |
| 265 | ast::InterpolatedStringElement::Literal(lit) => { |
| 266 | self.check_fstring_literal(lit.range); |
| 267 | } |
| 268 | ast::InterpolatedStringElement::Interpolation(interp) => { |
| 269 | self.visit_expr(&interp.expression); |
| 270 | if let Some(spec) = &interp.format_spec { |
| 271 | self.visit_fstring_elements(&spec.elements); |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | } |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | impl<'a> Visitor<'a> for EscapeWarningVisitor<'a> { |
no test coverage detected