chore: clippy

This commit is contained in:
Edward Langley
2026-04-07 00:16:25 -07:00
parent 386b9f6b27
commit 6f3af34056
3 changed files with 9 additions and 14 deletions

View File

@ -82,7 +82,7 @@ impl<'a> GridWidget<'a> {
.map(|s| s.width() as u16)
.max()
.unwrap_or(0);
(max_label + 1).max(MIN_ROW_HEADER_W).min(MAX_ROW_HEADER_W)
(max_label + 1).clamp(MIN_ROW_HEADER_W, MAX_ROW_HEADER_W)
})
.collect();
let row_header_width: u16 = sub_widths.iter().sum();
@ -587,7 +587,7 @@ pub fn compute_col_widths(
}
widths
.into_iter()
.map(|w| (w + 1).max(MIN_COL_WIDTH).min(MAX_COL_WIDTH))
.map(|w| (w + 1).clamp(MIN_COL_WIDTH, MAX_COL_WIDTH))
.collect()
}
@ -613,7 +613,7 @@ pub fn compute_row_header_width(layout: &GridLayout) -> u16 {
.map(|s| s.width() as u16)
.max()
.unwrap_or(0);
(max_label + 1).max(MIN_ROW_HEADER_W).min(MAX_ROW_HEADER_W)
(max_label + 1).clamp(MIN_ROW_HEADER_W, MAX_ROW_HEADER_W)
})
.collect();
sub_widths.iter().sum()
@ -632,8 +632,8 @@ pub fn compute_visible_cols(
.saturating_sub(row_header_width);
let mut acc = 0u16;
let mut count = 0usize;
for ci in col_offset..col_widths.len() {
let w = col_widths[ci];
for w in &col_widths[col_offset..] {
let w = *w;
if acc + w > data_area_width {
break;
}