From a5261feca3480e6d5f86bd11fbe60c31916d067a Mon Sep 17 00:00:00 2001 From: Franz Dietrich Date: Sat, 19 Sep 2026 11:58:17 +0200 Subject: [PATCH] Update turtle-lib/src/general/fontsize.rs Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- turtle-lib/src/general/fontsize.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turtle-lib/src/general/fontsize.rs b/turtle-lib/src/general/fontsize.rs index 42f7fe2..802f1b4 100644 --- a/turtle-lib/src/general/fontsize.rs +++ b/turtle-lib/src/general/fontsize.rs @@ -49,7 +49,7 @@ impl From for FontSize { impl From for FontSize { fn from(size: usize) -> Self { - Self((size as u16).max(1)) + Self(u16::try_from(size).unwrap_or(u16::MAX).max(1)) } }