Implement IntoIterator for FStringElements (#11410)

A change which I lost somewhere when I force pushed in
https://github.com/astral-sh/ruff/pull/11400
This commit is contained in:
Dhruv Manilawala 2024-05-13 21:54:49 +05:30 committed by GitHub
parent ca99e9e2f0
commit c3c87e86ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 26 additions and 8 deletions

View file

@ -746,7 +746,7 @@ pub fn walk_pattern_keyword<V: Transformer + ?Sized>(
}
pub fn walk_f_string<V: Transformer + ?Sized>(visitor: &V, f_string: &mut FString) {
for element in f_string.elements.iter_mut() {
for element in &mut f_string.elements {
visitor.visit_f_string_element(element);
}
}
@ -763,7 +763,7 @@ pub fn walk_f_string_element<V: Transformer + ?Sized>(
{
visitor.visit_expr(expression);
if let Some(format_spec) = format_spec {
for spec_element in format_spec.elements.iter_mut() {
for spec_element in &mut format_spec.elements {
visitor.visit_f_string_element(spec_element);
}
}