diff --git a/src/config.rs b/src/config.rs index 424859a..d6a80e4 100644 --- a/src/config.rs +++ b/src/config.rs @@ -292,7 +292,7 @@ impl Config { let color_schemes = self.color_schemes(color_scheme_kind); let mut color_scheme_names = Vec::<(String, ColorSchemeId)>::with_capacity(color_schemes.len()); - for (color_scheme_id, color_scheme) in color_schemes.iter() { + for (color_scheme_id, color_scheme) in color_schemes { let mut name = color_scheme.name.clone(); let mut copies = 1; @@ -328,7 +328,7 @@ impl Config { // Get a sorted and adjusted for duplicates list of profile names and ids pub fn profile_names(&self) -> Vec<(String, ProfileId)> { let mut profile_names = Vec::<(String, ProfileId)>::with_capacity(self.profiles.len()); - for (profile_id, profile) in self.profiles.iter() { + for (profile_id, profile) in &self.profiles { let mut name = profile.name.clone(); let mut copies = 1; diff --git a/src/main.rs b/src/main.rs index 6a370f1..dc981d8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -746,7 +746,7 @@ impl App { .into(), ); - for error in self.color_scheme_errors.iter() { + for error in &self.color_scheme_errors { sections.push( widget::row::with_children(vec![ icon_cache_get("dialog-error-symbolic", 16) @@ -1592,7 +1592,7 @@ impl Application for App { self.dialog_opt = None; if let DialogResult::Open(paths) = result { self.color_scheme_errors.clear(); - for path in paths.iter() { + for path in &paths { let mut file = match fs::File::open(path) { Ok(ok) => ok, Err(err) => { @@ -1831,7 +1831,7 @@ impl Application for App { config_set!(focus_follow_mouse, focus_follow_mouse); } Message::Key(modifiers, key) => { - for (key_bind, action) in self.key_binds.iter() { + for (key_bind, action) in &self.key_binds { if key_bind.matches(modifiers, &key) { return self.update(action.message(None)); } diff --git a/src/menu.rs b/src/menu.rs index a97dd05..301987c 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -26,7 +26,7 @@ pub fn context_menu<'a>( entity: segmented_button::Entity, ) -> Element<'a, Message> { let find_key = |action: &Action| -> String { - for (key_bind, key_action) in key_binds.iter() { + for (key_bind, key_action) in key_binds { if action == key_action { return key_bind.to_string(); } diff --git a/src/terminal_box.rs b/src/terminal_box.rs index aec9eec..f2f4661 100644 --- a/src/terminal_box.rs +++ b/src/terminal_box.rs @@ -165,7 +165,7 @@ where // Calculate layout lines terminal.with_buffer(|buffer| { let mut layout_lines = 0; - for line in buffer.lines.iter() { + for line in &buffer.lines { match line.layout_opt() { Some(layout) => layout_lines += layout.len(), None => (), @@ -480,7 +480,7 @@ where view_position, metadata_set, }; - for glyph in run.glyphs.iter() { + for glyph in run.glyphs { bg_rect.update(glyph, renderer, state.is_focused); } bg_rect.fill(renderer, state.is_focused); @@ -598,7 +598,7 @@ where modifiers, .. }) if state.is_focused => { - for (key_bind, _) in self.key_binds.iter() { + for (key_bind, _) in &self.key_binds { if key_bind.matches(modifiers, &Key::Named(named)) { return Status::Captured; } @@ -741,7 +741,7 @@ where key, .. }) if state.is_focused => { - for (key_bind, _) in self.key_binds.iter() { + for (key_bind, _) in &self.key_binds { if key_bind.matches(modifiers, &key) { return Status::Captured; }