From e77a97e8543c782342f257004addcb0429bd7841 Mon Sep 17 00:00:00 2001 From: CAD97 Date: Sun, 4 Jul 2021 17:42:39 -0500 Subject: [PATCH] Add a couple trivial const fn conversions --- src/base/dimension.rs | 2 +- src/base/unit.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/dimension.rs b/src/base/dimension.rs index 2b5ccec3..8573dd59 100644 --- a/src/base/dimension.rs +++ b/src/base/dimension.rs @@ -20,7 +20,7 @@ pub struct Dynamic { impl Dynamic { /// A dynamic size equal to `value`. #[inline] - pub fn new(value: usize) -> Self { + pub const fn new(value: usize) -> Self { Self { value } } } diff --git a/src/base/unit.rs b/src/base/unit.rs index 32eff82f..8571728f 100644 --- a/src/base/unit.rs +++ b/src/base/unit.rs @@ -221,7 +221,7 @@ impl Unit { impl Unit { /// Wraps the given value, assuming it is already normalized. #[inline] - pub fn new_unchecked(value: T) -> Self { + pub const fn new_unchecked(value: T) -> Self { Unit { value } }