the light is getting closer

This commit is contained in:
2025-05-04 04:12:56 -04:00
parent 5f36be9de9
commit 6583d47ef8
23 changed files with 1261 additions and 740 deletions
+28
View File
@@ -79,6 +79,20 @@ impl<T> IndexMut<&ID<T>> for Vec<T> {
}
}
impl<T> Index<&mut ID<T>> for Vec<T> {
type Output = T;
fn index(&self, i: &mut ID<T>) -> &Self::Output {
&self[i.0]
}
}
impl<T> IndexMut<&mut ID<T>> for Vec<T> {
fn index_mut(&mut self, i: &mut ID<T>) -> &mut Self::Output {
&mut self[i.0]
}
}
impl<T> Index<ID<T>> for [T] {
type Output = T;
@@ -106,3 +120,17 @@ impl<T> IndexMut<&ID<T>> for [T] {
&mut self[i.0]
}
}
impl<T> Index<&mut ID<T>> for [T] {
type Output = T;
fn index(&self, i: &mut ID<T>) -> &Self::Output {
&self[i.0]
}
}
impl<T> IndexMut<&mut ID<T>> for [T] {
fn index_mut(&mut self, i: &mut ID<T>) -> &mut Self::Output {
&mut self[i.0]
}
}