Skip to content

Commit 102033d

Browse files
committed
Make Dim::new and *ViewRepr::new const fns
1 parent 56dc44b commit 102033d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/dimension/dim.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub struct Dim<I: ?Sized> {
4242

4343
impl<I> Dim<I> {
4444
/// Private constructor and accessors for Dim
45-
pub(crate) fn new(index: I) -> Dim<I> {
45+
pub(crate) const fn new(index: I) -> Dim<I> {
4646
Dim { index }
4747
}
4848
#[inline(always)]

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ pub struct RawViewRepr<A> {
14451445

14461446
impl<A> RawViewRepr<A> {
14471447
#[inline(always)]
1448-
fn new() -> Self {
1448+
const fn new() -> Self {
14491449
RawViewRepr { ptr: PhantomData }
14501450
}
14511451
}
@@ -1462,7 +1462,7 @@ pub struct ViewRepr<A> {
14621462

14631463
impl<A> ViewRepr<A> {
14641464
#[inline(always)]
1465-
fn new() -> Self {
1465+
const fn new() -> Self {
14661466
ViewRepr { life: PhantomData }
14671467
}
14681468
}

0 commit comments

Comments
 (0)