Merge pull request #928 from CAD97/moar-const

Add a couple trivial const fn conversions
This commit is contained in:
Sébastien Crozet 2021-07-05 06:55:17 -07:00 committed by GitHub
commit 5b2b174b8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ pub struct Dynamic {
impl Dynamic { impl Dynamic {
/// A dynamic size equal to `value`. /// A dynamic size equal to `value`.
#[inline] #[inline]
pub fn new(value: usize) -> Self { pub const fn new(value: usize) -> Self {
Self { value } Self { value }
} }
} }

View File

@ -221,7 +221,7 @@ impl<T: Normed> Unit<T> {
impl<T> Unit<T> { impl<T> Unit<T> {
/// Wraps the given value, assuming it is already normalized. /// Wraps the given value, assuming it is already normalized.
#[inline] #[inline]
pub fn new_unchecked(value: T) -> Self { pub const fn new_unchecked(value: T) -> Self {
Unit { value } Unit { value }
} }