diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-09 23:16:24 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-09 23:16:24 +0300 |
| commit | 9f210e973834700d14c6c0283ed750ed5b038e8b (patch) | |
| tree | cd8c75755c59fdc47bf71ca6dc34e49ab0258ae6 /src/ui/tabs.rs | |
| parent | 3a9888cd564dc45d23a7bdd0dba29a6ff1ef48a1 (diff) | |
chore: enable clippy linting
Diffstat (limited to 'src/ui/tabs.rs')
| -rw-r--r-- | src/ui/tabs.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ui/tabs.rs b/src/ui/tabs.rs index 400ee65f..a6ce0e68 100644 --- a/src/ui/tabs.rs +++ b/src/ui/tabs.rs @@ -33,14 +33,14 @@ fn layout_tab_hit_areas(ws: &crate::workspace::Workspace, area: Rect, scroll: us let mut x = area.x; let right = area.x + area.width; - for idx in scroll..ws.tabs.len() { + for (idx, rect) in rects.iter_mut().enumerate().skip(scroll) { if x >= right { break; } let desired = tab_width(&ws.tabs[idx]); let remaining = right.saturating_sub(x); let width = desired.min(remaining).max(1); - rects[idx] = Rect::new(x, area.y, width, 1); + *rect = Rect::new(x, area.y, width, 1); x = x.saturating_add(width + 1); } rects @@ -178,14 +178,14 @@ fn tab_drop_indicator_x( ws: &crate::workspace::Workspace, insert_idx: usize, ) -> Option<u16> { - let visible_tabs = app + let mut visible_tabs = app .view .tab_hit_areas .iter() .enumerate() .filter(|(_, rect)| rect.width > 0); let first_visible = visible_tabs.clone().next()?; - let last_visible = visible_tabs.last().unwrap_or(first_visible); + let last_visible = visible_tabs.next_back().unwrap_or(first_visible); if insert_idx == 0 { return Some(if first_visible.0 == 0 { |
