From b0362577291ca8235b7d0a866aba8524e539d810 Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Sun, 10 Apr 2022 16:40:42 +0200 Subject: [PATCH] Make `FontId` functions constant (#1463) --- epaint/src/text/fonts.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epaint/src/text/fonts.rs b/epaint/src/text/fonts.rs index 0d8c7cd8..3c8f526c 100644 --- a/epaint/src/text/fonts.rs +++ b/epaint/src/text/fonts.rs @@ -36,17 +36,17 @@ impl Default for FontId { impl FontId { #[inline] - pub fn new(size: f32, family: FontFamily) -> Self { + pub const fn new(size: f32, family: FontFamily) -> Self { Self { size, family } } #[inline] - pub fn proportional(size: f32) -> Self { + pub const fn proportional(size: f32) -> Self { Self::new(size, FontFamily::Proportional) } #[inline] - pub fn monospace(size: f32) -> Self { + pub const fn monospace(size: f32) -> Self { Self::new(size, FontFamily::Monospace) } }