Skip to content

Commit

Permalink
switch update loops to use iterator/enumerate() per Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
alefnull committed Aug 6, 2024
1 parent 18a5981 commit e44132d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl App {
if !input_text.is_empty() {
for text in &input_text {
let logo_str = figlet(text, &font,)?;
logo_sizes.push(fig_size(&logo_str.as_str(),)?,);
logo_sizes.push(fig_size(logo_str.as_str(),)?,);
logo_strs.push(logo_str,);
}
}
Expand Down Expand Up @@ -134,7 +134,7 @@ impl App {
let mut bounces: Vec<bool,> = vec![false; self.logo_strings.len()];

if !plain {
for i in 0..self.logo_strings.len() {
for (i, _,) in self.logo_strings.iter().enumerate() {
if self.positions[i].x + self.directions[i].x < 0 {
bounces[i] = true;
self.positions[i].x = 0;
Expand Down Expand Up @@ -167,7 +167,7 @@ impl App {
}
}
else {
for i in 0..self.logo_strings.len() {
for (i, _,) in self.logo_strings.iter().enumerate() {
if self.positions[i].x + self.directions[i].x < 0 {
bounces[i] = true;
self.positions[i].x = 0;
Expand Down Expand Up @@ -199,7 +199,7 @@ impl App {
}
}

for i in 0..self.logo_strings.len() {
for (i, _,) in self.logo_strings.iter().enumerate() {
self.positions[i].x += self.directions[i].x;
self.positions[i].y += self.directions[i].y;

Expand Down

0 comments on commit e44132d

Please sign in to comment.