Replace a couple for loops with .for_each

I will not be explaining why (maybe unless you ask me)
This commit is contained in:
Maybe Waffle 2023-11-05 23:39:36 +01:00
parent f4dd70604c
commit 0017480467

View file

@ -326,9 +326,9 @@ impl_visit_parse_modes! {
impl VisitParseModes for AnswerInlineQuery { impl VisitParseModes for AnswerInlineQuery {
fn visit_parse_modes(&mut self, mut visitor: impl FnMut(&mut Option<ParseMode>)) { fn visit_parse_modes(&mut self, mut visitor: impl FnMut(&mut Option<ParseMode>)) {
for result in &mut self.results { self.results
visit_parse_modes_in_inline_query_result(result, &mut visitor); .iter_mut()
} .for_each(|result| visit_parse_modes_in_inline_query_result(result, &mut visitor))
} }
} }
@ -340,9 +340,9 @@ impl VisitParseModes for AnswerWebAppQuery {
impl VisitParseModes for SendMediaGroup { impl VisitParseModes for SendMediaGroup {
fn visit_parse_modes(&mut self, mut visitor: impl FnMut(&mut Option<ParseMode>)) { fn visit_parse_modes(&mut self, mut visitor: impl FnMut(&mut Option<ParseMode>)) {
for media in &mut self.media { self.media
visit_parse_modes_in_input_media(media, &mut visitor); .iter_mut()
} .for_each(|media| visit_parse_modes_in_input_media(media, &mut visitor))
} }
} }