Skip to content

Commit ada4d0c

Browse files
jturner314bluss
authored andcommitted
Make Dim::new and *ViewRepr::new const fns
1 parent c476909 commit ada4d0c

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
@@ -1450,7 +1450,7 @@ pub struct RawViewRepr<A> {
14501450

14511451
impl<A> RawViewRepr<A> {
14521452
#[inline(always)]
1453-
fn new() -> Self {
1453+
const fn new() -> Self {
14541454
RawViewRepr { ptr: PhantomData }
14551455
}
14561456
}
@@ -1467,7 +1467,7 @@ pub struct ViewRepr<A> {
14671467

14681468
impl<A> ViewRepr<A> {
14691469
#[inline(always)]
1470-
fn new() -> Self {
1470+
const fn new() -> Self {
14711471
ViewRepr { life: PhantomData }
14721472
}
14731473
}

0 commit comments

Comments
 (0)