Fix clamp-like pattern warning in font.rs (#33705)

Signed-off-by: L Ashwin B <lashwinib@gmail.com>
This commit is contained in:
chickenleaf 2024-10-08 15:48:53 +05:30 committed by GitHub
parent 77f7b43548
commit 9862df877d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -167,7 +167,7 @@ impl PlatformFontMethods for PlatformFont {
};
let weight = StyleFontWeight::from_float(weight_val as f32);
let stretch = match min(9, max(1, width_val)) {
let stretch = match width_val.clamp(1, 9) {
1 => StyleFontStretch::ULTRA_CONDENSED,
2 => StyleFontStretch::EXTRA_CONDENSED,
3 => StyleFontStretch::CONDENSED,