1
Fork 0

const-ify some {IndexVec, IndexSlice} methods

This commit is contained in:
Maybe Waffle 2023-04-19 11:12:42 +00:00
parent 99ebfe2f15
commit 7d23b52376
2 changed files with 11 additions and 11 deletions

View file

@ -26,12 +26,12 @@ pub struct IndexVec<I: Idx, T> {
impl<I: Idx, T> IndexVec<I, T> {
#[inline]
pub fn new() -> Self {
pub const fn new() -> Self {
IndexVec { raw: Vec::new(), _marker: PhantomData }
}
#[inline]
pub fn from_raw(raw: Vec<T>) -> Self {
pub const fn from_raw(raw: Vec<T>) -> Self {
IndexVec { raw, _marker: PhantomData }
}