chore: enforce clippy lints across workspace
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run

This commit is contained in:
2026-11-20 08:14:03 +07:00
parent 51dd5c8630
commit 01c3ced1c7
85 changed files with 2773 additions and 2001 deletions
+6 -3
View File
@@ -37,6 +37,9 @@ type DisclosureHandler = Rc<dyn Fn(usize, &mut Window, &mut App)>;
/// The visible row builder, run during render.
type ItemsFn = Box<dyn Fn(&mut Window, &mut App) -> Vec<TreeItem>>;
/// The deepest indent the tree paints, bounding misbuilt item trees.
const TREE_MAX_DEPTH: usize = 16;
/// One row of a [`Tree`].
#[derive(Clone)]
#[must_use]
@@ -362,7 +365,7 @@ impl TreeItem {
let label_color = selectable_label_color(cx, selected, self.disabled);
let disabled = self.disabled;
let depth = u32::try_from(self.depth).unwrap_or(u32::MAX) as f32;
let depth = self.depth.min(TREE_MAX_DEPTH) as f32;
let indent = rems(0.75 * if self.depth == 0 { 0.5 } else { depth + 1.0 });
div()
@@ -402,8 +405,8 @@ impl TreeItem {
}
})
})
.children((0..self.depth).map(|level| {
let step = u32::try_from(level).unwrap_or(u32::MAX) as f32;
.children((0..self.depth.min(TREE_MAX_DEPTH)).map(|level| {
let step = level as f32;
div()
.absolute()
.left(rems(0.75 * (step + 0.5)))