Skip to content

Commit c476909

Browse files
jturner314bluss
authored andcommitted
Make Ix* functions const fn
1 parent f0f4849 commit c476909

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/aliases.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,43 @@ use crate::{ArcArray, Array, ArrayView, ArrayViewMut, Ix, IxDynImpl};
77
/// Create a zero-dimensional index
88
#[allow(non_snake_case)]
99
#[inline(always)]
10-
pub fn Ix0() -> Ix0 {
10+
pub const fn Ix0() -> Ix0 {
1111
Dim::new([])
1212
}
1313
/// Create a one-dimensional index
1414
#[allow(non_snake_case)]
1515
#[inline(always)]
16-
pub fn Ix1(i0: Ix) -> Ix1 {
16+
pub const fn Ix1(i0: Ix) -> Ix1 {
1717
Dim::new([i0])
1818
}
1919
/// Create a two-dimensional index
2020
#[allow(non_snake_case)]
2121
#[inline(always)]
22-
pub fn Ix2(i0: Ix, i1: Ix) -> Ix2 {
22+
pub const fn Ix2(i0: Ix, i1: Ix) -> Ix2 {
2323
Dim::new([i0, i1])
2424
}
2525
/// Create a three-dimensional index
2626
#[allow(non_snake_case)]
2727
#[inline(always)]
28-
pub fn Ix3(i0: Ix, i1: Ix, i2: Ix) -> Ix3 {
28+
pub const fn Ix3(i0: Ix, i1: Ix, i2: Ix) -> Ix3 {
2929
Dim::new([i0, i1, i2])
3030
}
3131
/// Create a four-dimensional index
3232
#[allow(non_snake_case)]
3333
#[inline(always)]
34-
pub fn Ix4(i0: Ix, i1: Ix, i2: Ix, i3: Ix) -> Ix4 {
34+
pub const fn Ix4(i0: Ix, i1: Ix, i2: Ix, i3: Ix) -> Ix4 {
3535
Dim::new([i0, i1, i2, i3])
3636
}
3737
/// Create a five-dimensional index
3838
#[allow(non_snake_case)]
3939
#[inline(always)]
40-
pub fn Ix5(i0: Ix, i1: Ix, i2: Ix, i3: Ix, i4: Ix) -> Ix5 {
40+
pub const fn Ix5(i0: Ix, i1: Ix, i2: Ix, i3: Ix, i4: Ix) -> Ix5 {
4141
Dim::new([i0, i1, i2, i3, i4])
4242
}
4343
/// Create a six-dimensional index
4444
#[allow(non_snake_case)]
4545
#[inline(always)]
46-
pub fn Ix6(i0: Ix, i1: Ix, i2: Ix, i3: Ix, i4: Ix, i5: Ix) -> Ix6 {
46+
pub const fn Ix6(i0: Ix, i1: Ix, i2: Ix, i3: Ix, i4: Ix, i5: Ix) -> Ix6 {
4747
Dim::new([i0, i1, i2, i3, i4, i5])
4848
}
4949

0 commit comments

Comments
 (0)