Update turtle-lib/src/general/fontsize.rs
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
@@ -49,7 +49,7 @@ impl From<f64> for FontSize {
|
||||
|
||||
impl From<usize> for FontSize {
|
||||
fn from(size: usize) -> Self {
|
||||
Self((size as u16).max(1))
|
||||
Self(u16::try_from(size).unwrap_or(u16::MAX).max(1))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user