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 } }