@@ -101,13 +101,12 @@ where
101101 . map ( |i| offset + i)
102102}
103103
104- /// Iterator over a column map's entries as `(&K, &V)` pairs — what
105- /// [`UnsortedColumnMap::iter`] and
106- /// [`SortedColumnMap::iter`](crate::SortedColumnMap::iter) return, and what `&map`
107- /// iterates as.
104+ /// Iterator over a column map's entries as `(&K, &V)` pairs.
108105///
109- /// Zips the two dense column slices back into entries; double-ended, exact-size,
110- /// and fused, like the slice iterators underneath.
106+ /// What [`UnsortedColumnMap::iter`] and
107+ /// [`SortedColumnMap::iter`](crate::SortedColumnMap::iter) return, and what `&map`
108+ /// iterates as. Zips the two dense column slices back into entries; double-ended,
109+ /// exact-size, and fused, like the slice iterators underneath.
111110// A named struct rather than a bare `Zip<…>` alias, so the returned type is
112111// nameable and stable while the two-store representation stays private —
113112// mirroring [`MapIter`](crate::MapIter) for the single-store maps.
@@ -186,14 +185,14 @@ impl<K, V> ExactSizeIterator for ColumnIter<'_, K, V> {
186185
187186impl < K , V > core:: iter:: FusedIterator for ColumnIter < ' _ , K , V > { }
188187
189- /// Iterator over a column map's entries as `(&K, &mut V)` pairs — what
190- /// [`UnsortedColumnMap::iter_mut`] and
191- /// [`SortedColumnMap::iter_mut`](crate::SortedColumnMap::iter_mut) return.
188+ /// Iterator over a column map's entries as `(&K, &mut V)` pairs.
192189///
193- /// Zips the dense key column against a mutable walk of the value column;
194- /// double-ended, exact-size, and fused. Not cloneable — the value borrows are unique;
195- /// the key stays shared so map invariants can't be broken through it. Named like
196- /// [`ColumnIter`] so the return type is nameable and stable.
190+ /// What [`UnsortedColumnMap::iter_mut`] and
191+ /// [`SortedColumnMap::iter_mut`](crate::SortedColumnMap::iter_mut) return. Zips the dense
192+ /// key column against a mutable walk of the value column; double-ended, exact-size, and
193+ /// fused. Not cloneable — the value borrows are unique; the key stays shared so map
194+ /// invariants can't be broken through it. Named like [`ColumnIter`] so the return type is
195+ /// nameable and stable.
197196#[ derive( Debug ) ]
198197pub struct ColumnIterMut < ' a , K , V > {
199198 inner : core:: iter:: Zip < core:: slice:: Iter < ' a , K > , core:: slice:: IterMut < ' a , V > > ,
@@ -257,12 +256,12 @@ impl<K, V> ExactSizeIterator for ColumnIterMut<'_, K, V> {
257256
258257impl < K , V > core:: iter:: FusedIterator for ColumnIterMut < ' _ , K , V > { }
259258
260- /// Mutable iterator over a column map's values — what
261- /// [`UnsortedColumnMap::values_mut`] and
262- /// [`SortedColumnMap::values_mut`](crate::SortedColumnMap::values_mut) return.
259+ /// Mutable iterator over a column map's values.
263260///
264- /// A thin wrapper over the value column's `&mut [V]` slice iterator (double-ended,
265- /// exact-size, fused). Not cloneable — the value borrows are unique.
261+ /// What [`UnsortedColumnMap::values_mut`] and
262+ /// [`SortedColumnMap::values_mut`](crate::SortedColumnMap::values_mut) return. A thin
263+ /// wrapper over the value column's `&mut [V]` slice iterator (double-ended, exact-size,
264+ /// fused). Not cloneable — the value borrows are unique.
266265#[ derive( Debug ) ]
267266pub struct ColumnValuesMut < ' a , V > {
268267 inner : core:: slice:: IterMut < ' a , V > ,
@@ -361,12 +360,12 @@ pub(crate) fn retain_columns<K, V, SK, SV>(
361360 }
362361}
363362
364- /// A map with no key ordering, stored **column-wise**: keys in `SK`, values in `SV`, kept
365- /// the same length.
363+ /// A map with no key ordering, stored **column-wise**.
366364///
367- /// The struct-of-arrays counterpart of [`UnsortedMap`](crate::UnsortedMap) — trades the
368- /// `&[(K, V)]` view for a dense, value-free key scan (faster for large values; see the
369- /// module docs). Needs only `K: Eq`.
365+ /// Keys live in `SK`, values in `SV`, kept the same length. The struct-of-arrays
366+ /// counterpart of [`UnsortedMap`](crate::UnsortedMap) — trades the `&[(K, V)]` view for a
367+ /// dense, value-free key scan (faster for large values; see the module docs). Needs only
368+ /// `K: Eq`.
370369///
371370/// Panicking key/value destructors are unsupported: the two columns are mutated in
372371/// sequence, so a destructor that unwinds mid-mutation (in [`remove`](Self::remove),
@@ -417,9 +416,9 @@ impl<SK: Store, SV: Store> UnsortedColumnMap<SK, SV> {
417416 pub fn max_capacity ( & self ) -> Option < usize > {
418417 combined_capacity ( self . keys . max_capacity ( ) , self . values . max_capacity ( ) )
419418 }
420- /// Returns the keys as a contiguous slice — the dense scan target .
419+ /// Returns the keys as a contiguous slice.
421420 ///
422- /// `zip` with [`values`](Self::values) to iterate entries.
421+ /// The dense scan target. `zip` with [`values`](Self::values) to iterate entries.
423422 #[ must_use]
424423 pub fn keys ( & self ) -> & [ SK :: Elem ] {
425424 self . keys . as_slice ( )
@@ -433,19 +432,20 @@ impl<SK: Store, SV: Store> UnsortedColumnMap<SK, SV> {
433432}
434433
435434impl < SK : Store , SV : Store > UnsortedColumnMap < SK , SV > {
436- /// Borrows the two backing stores, `(keys, values)` — the door to backend-specific
437- /// introspection (`spilled()`, allocated capacity, …), as
438- /// [`SortedSet::store`](crate::SortedSet::store) is for the single-store collections.
435+ /// Borrows the two backing stores, `(keys, values)`.
439436 ///
440- /// Shared-ref only: `&mut` access could desync the columns or smuggle in a duplicate
441- /// key.
437+ /// The door to backend-specific introspection (`spilled()`, allocated capacity, …),
438+ /// as [`SortedSet::store`](crate::SortedSet::store) is for the single-store
439+ /// collections. Shared-ref only: `&mut` access could desync the columns or
440+ /// smuggle in a duplicate key.
442441 #[ must_use]
443442 pub fn stores ( & self ) -> ( & SK , & SV ) {
444443 ( & self . keys , & self . values )
445444 }
446- /// Consumes the map and hands back its stores, `(keys, values)`, entries
447- /// intact and index-aligned — the inverse of
448- /// [`from_store`](Self::from_store).
445+ /// Consumes the map and returns its stores, `(keys, values)`, entries intact and
446+ /// index-aligned.
447+ ///
448+ /// The inverse of [`from_store`](Self::from_store).
449449 #[ must_use]
450450 pub fn into_stores ( self ) -> ( SK , SV ) {
451451 ( self . keys , self . values )
@@ -460,9 +460,10 @@ impl<SK: StoreMut, SV: StoreMut> UnsortedColumnMap<SK, SV> {
460460 self . keys . clear ( ) ;
461461 self . values . clear ( ) ;
462462 }
463- /// Pre-allocates both columns so at least `additional` more entries fit
464- /// without a reallocation — see
465- /// [`SortedSet::reserve`](crate::SortedSet::reserve).
463+ /// Pre-allocates both columns so at least `additional` more entries fit without a
464+ /// reallocation.
465+ ///
466+ /// See [`SortedSet::reserve`](crate::SortedSet::reserve).
466467 pub fn reserve ( & mut self , additional : usize ) {
467468 self . keys . reserve ( additional) ;
468469 self . values . reserve ( additional) ;
@@ -493,8 +494,9 @@ where
493494 SK : StoreMut < Elem = K > ,
494495 SV : StoreMut < Elem = V > ,
495496{
496- /// Returns an iterator over the entries as `(&K, &mut V)` pairs — bulk in-place value
497- /// updates, the dense `&mut [V]` walk SoA vectorizes best.
497+ /// Returns an iterator over the entries as `(&K, &mut V)` pairs.
498+ ///
499+ /// Bulk in-place value updates, the dense `&mut [V]` walk SoA vectorizes best.
498500 #[ must_use]
499501 pub fn iter_mut ( & mut self ) -> ColumnIterMut < ' _ , K , V > {
500502 ColumnIterMut :: new ( self . keys . as_slice ( ) , self . values . as_mut_slice ( ) )
@@ -521,11 +523,11 @@ where
521523 SV : Store < Elem = V > ,
522524 K : Eq ,
523525{
524- /// Wraps two stores **assumed equal-length and free of duplicate keys** — the
525- /// column-map invariants.
526+ /// Wraps two stores **assumed equal-length and free of duplicate keys**.
526527 ///
527- /// No scan or alignment is performed; a length mismatch would desync key/value pairs
528- /// and a duplicate key would shadow itself. Both preconditions are
528+ /// The column-map invariants. No scan or alignment is performed; a length mismatch
529+ /// would desync key/value pairs and a duplicate key would shadow itself. Both
530+ /// preconditions are
529531 /// `debug_assert!`-checked (zero cost in release). To build from an arbitrary
530532 /// iterator, use [`try_from_iter`](Self::try_from_iter).
531533 ///
@@ -608,10 +610,10 @@ where
608610 SV : StoreMut < Elem = V > ,
609611 K : Eq ,
610612{
611- /// Returns a mutable reference to `key`'s value, or `None` if absent — for an
612- /// in-place update without the [`entry`](Self::entry) ceremony.
613+ /// Returns a mutable reference to `key`'s value, or `None` if absent.
613614 ///
614- /// No E0311 lifetime dance (unlike
615+ /// For an in-place update without the [`entry`](Self::entry) ceremony. No E0311
616+ /// lifetime dance (unlike
615617 /// [`UnsortedMap::get_mut`](crate::UnsortedMap::get_mut)): the value column is
616618 /// already `&mut [V]`, so elision ties the result to `&mut self`. `key` may be any
617619 /// borrowed form of `K`, like [`get`](Self::get).
@@ -771,10 +773,10 @@ where
771773 SV : StoreMut < Elem = V > + Unbounded ,
772774 K : Eq ,
773775{
774- /// Infallibly inserts or replaces, returning the previous value — available only when
775- /// **both** columns are [`Unbounded`].
776+ /// Infallibly inserts or replaces, returning the previous value.
776777 ///
777- /// The infallible twin of [`try_insert`](Self::try_insert).
778+ /// Available only when **both** columns are [`Unbounded`]. The infallible twin of
779+ /// [`try_insert`](Self::try_insert).
778780 pub fn insert ( & mut self , key : K , value : V ) -> Option < V > {
779781 match self . try_insert ( key, value) {
780782 Ok ( prev) => prev,
@@ -821,10 +823,10 @@ where
821823 SV : StoreMut < Elem = V > + Unbounded ,
822824 K : Eq ,
823825{
824- /// Extends the map, last-wins and infallible — available only when **both** columns
825- /// are [`Unbounded`].
826+ /// Extends the map, last-wins and infallible.
826827 ///
827- /// As with [`UnsortedMap`](crate::UnsortedMap), there is deliberately no
828+ /// Available only when **both** columns are [`Unbounded`]. As with
829+ /// [`UnsortedMap`](crate::UnsortedMap), there is deliberately no
828830 /// `FromIterator`: fresh construction rejects duplicate keys, while `extend`
829831 /// overrides them.
830832 fn extend < I : IntoIterator < Item = ( K , V ) > > ( & mut self , iter : I ) {
0 commit comments