Rename rest to leftover

The length kind that asks for a part of what is left once the fixed
lengths are taken is called leftover: Len::leftover(2), Len::LEFTOVER,
Size::LEFTOVER, Len::leftover the field, and apply_leftover. It says
what it is where "rest" reads as "the remainder of the list" as often as
"the remaining space", and every agent who has touched this has reached
for a third word for it.

Locals called rest that meant a region or a widget are renamed with it,
since the word now names something else.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
iris-aiandClaude Opus 5 committed 2026-09-15 14:22:52 -04:00
1 parent 9644971daf
commit 691e3eb23c
16 files changed
+98 -89

No files matched your search

+3 -3
View File
@@ -112,7 +112,7 @@ impl<'a> Painter<'a> {
}
/// What a widget declares its lengths to be, which whoever draws it
/// resolves into its box. `rest` is not among them: a share of what is
/// resolves into its box. `leftover` is not among them: a part of what is
/// left over is only a length to the widget dividing one, so it passes
/// up in the size instead. Reading it depends on nothing -- the box that
/// comes of it is kept on the child, and `redraw` compares it there.
@@ -439,11 +439,11 @@ impl PrimitiveLike for &TextureHandle {
}
}
/// What a widget declares a length of its box to be. `rest` is not one: a
/// What a widget declares a length of its box to be. `leftover` is not one: a
/// share of what is left over is only a length to the widget dividing one,
/// so it passes up in the size instead.
pub(crate) fn declared_len(widget: &dyn Widget, axis: Axis) -> Option<Len> {
widget.size_hint(axis).filter(|len| len.rest == 0.0)
widget.size_hint(axis).filter(|len| len.leftover == 0.0)
}
/// Takes a widget's declared lengths in the box `region` is given in, since a