From d50c1f13f6ae8242342daa6feae5721ab00445aa Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Fri, 26 Jan 2024 13:04:58 -0800 Subject: [PATCH] Fix subtract overflow --- src/widgets/toplevels.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/toplevels.rs b/src/widgets/toplevels.rs index cb01405..c8e393b 100644 --- a/src/widgets/toplevels.rs +++ b/src/widgets/toplevels.rs @@ -74,7 +74,7 @@ impl<'a, Msg> Widget for Toplevels<'a, Msg> { let spacing = 16; // Get total requested main axis length if widget could have all the space - let total_spacing = spacing * (self.children.len() - 1).max(0); + let total_spacing = spacing * (self.children.len().saturating_sub(1)).max(0); let requested_mains = self .children .iter()