src/collection.rs

branch
dev
changeset 124
6aa955ad8122
parent 59
9226980e45a7
--- a/src/collection.rs	Thu May 01 08:40:33 2025 -0500
+++ b/src/collection.rs	Thu May 01 13:06:58 2025 -0500
@@ -5,20 +5,24 @@
 use crate::loc::Loc;
 
 /// An abstract collection of elements.
-pub trait Collection : IntoIterator<Item = Self::Element> {
+pub trait Collection: IntoIterator<Item = Self::Element> {
     /// Type of elements of the collection
     type Element;
     /// Iterator over references to elements of the collection
-    type RefsIter<'a> : Iterator<Item=&'a Self::Element> where Self : 'a;
+    type RefsIter<'a>: Iterator<Item = &'a Self::Element>
+    where
+        Self: 'a;
 
     /// Returns an iterator over references to elements of the collection.
     fn iter_refs(&self) -> Self::RefsIter<'_>;
 }
 
 /// An abstract collection of mutable elements.
-pub trait CollectionMut : Collection {
+pub trait CollectionMut: Collection {
     /// Iterator over references to elements of the collection
-    type RefsIterMut<'a> : Iterator<Item=&'a mut Self::Element> where Self : 'a;
+    type RefsIterMut<'a>: Iterator<Item = &'a mut Self::Element>
+    where
+        Self: 'a;
 
     /// Returns an iterator over references to elements of the collection.
     fn iter_refs_mut(&mut self) -> Self::RefsIterMut<'_>;
@@ -51,4 +55,4 @@
 
 slice_like_collection!(Vec<E> where E);
 slice_like_collection!([E; N] where E, const N : usize);
-slice_like_collection!(Loc<E, N> where E, const N : usize);
+slice_like_collection!(Loc<N, E> where E, const N : usize);

mercurial