use crate::{ConcurrentSlice, ConcurrentVec, elem::ConcurrentElement};
use core::ops::Index;
use orx_pinned_vec::IntoConcurrentPinnedVec;
impl<P, T> Index<usize> for ConcurrentVec<T, P>
where
P: IntoConcurrentPinnedVec<ConcurrentElement<T>>,
{
type Output = ConcurrentElement<T>;
fn index(&self, i: usize) -> &Self::Output {
self.get(i).expect("out-of-bounds")
}
}
impl<P, T> Index<usize> for ConcurrentSlice<'_, T, P>
where
P: IntoConcurrentPinnedVec<ConcurrentElement<T>>,
{
type Output = ConcurrentElement<T>;
fn index(&self, i: usize) -> &Self::Output {
self.get(i).expect("out-of-bounds")
}
}