From da0fcfd21ac0efedd37b29a37d83fe7cc7d2bfdf Mon Sep 17 00:00:00 2001 From: aiongg Date: Mon, 16 Nov 2026 13:27:45 +0000 Subject: [PATCH] design-lint: props: derive the setters of ui-widgets components (#[prop]) and drop the hand setters --- crates/ui-widgets/src/text/linked.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/crates/ui-widgets/src/text/linked.rs b/crates/ui-widgets/src/text/linked.rs index d3d2bed2a..930533ba2 100644 --- a/crates/ui-widgets/src/text/linked.rs +++ b/crates/ui-widgets/src/text/linked.rs @@ -154,7 +154,9 @@ pub struct LinkedFields<'a, const N: usize> { /// Each field's own range. #[prop] ranges: Option<[RangeInclusive; N]>, - /// The lengths every field keeps and shows (`LinkedFields::lengths`); plain numbers without it. + /// Makes every field a length field (`NumberField::length`): the values are kept in `units.stored` and shown in + /// `units.shown`. `range` is then in the stored unit. + #[prop] lengths: Option, } @@ -176,14 +178,6 @@ impl<'a, const N: usize> LinkedFields<'a, N> { .label(label) } - /// Makes every field a length field (`NumberField::length`): the values are kept in `units.stored` and shown in - /// `units.shown`. `range` is then in the stored unit. - #[must_use] - pub fn lengths(mut self, units: LengthUnits) -> Self { - self.lengths = Some(units); - self - } - /// Shows a caption with each field that also scrubs it, and names the field: inside the field at its start in the /// `Row` layout, beside it in the others. Without captions a field is named by the group's label and its position. #[must_use]