Skip to content

Commit db2bbaf

Browse files
committed
docs: Update documentation to consistently reference FixedVec with backticks
1 parent 1c33969 commit db2bbaf

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

src/fixed/mod.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ impl StdError for Error {}
259259

260260
/// A compressed vector of integers with fixed-width encoding.
261261
///
262-
/// `FixedVec` stores a sequence of integers where each element is encoded using
262+
/// [`FixedVec`] stores a sequence of integers where each element is encoded using
263263
/// the same number of bits. This allows for O(1) random access by calculating
264264
/// the memory location of any element. It is suitable for data where values are
265265
/// bounded within a known range.
@@ -291,7 +291,7 @@ pub struct FixedVec<T: Storable<W>, W: Word, E: Endianness, B: AsRef<[W]> = Vec<
291291
pub(crate) _phantom: PhantomData<(T, W, E)>,
292292
}
293293

294-
// `FixedVec` builder implementation.
294+
// [`FixedVec`] builder implementation.
295295
impl<T, W, E> FixedVec<T, W, E, Vec<W>>
296296
where
297297
T: Storable<W>,
@@ -475,13 +475,13 @@ where
475475
/// # Safety
476476
///
477477
/// The caller must ensure that the buffer is not mutated in a way that
478-
/// violates the invariants of the `FixedVec` while the pointer is active.
478+
/// violates the invariants of the [`FixedVec`] while the pointer is active.
479479
pub fn as_raw_parts(&self) -> (*const W, usize) {
480480
let slice = self.bits.as_ref();
481481
(slice.as_ptr(), slice.len())
482482
}
483483

484-
/// Creates a `FixedVec` from its raw components without performing checks.
484+
/// Creates a [`FixedVec`] from its raw components without performing checks.
485485
///
486486
/// # Safety
487487
///
@@ -751,7 +751,7 @@ where
751751

752752
/// Returns a raw pointer to the storage word containing the start of an element.
753753
///
754-
/// This method returns a pointer to the `Word` in the backing buffer where
754+
/// This method returns a pointer to the [`Word`] in the backing buffer where
755755
/// the data for the element at `index` begins.
756756
///
757757
/// Returns `None` if `index` is out of bounds.
@@ -760,7 +760,7 @@ where
760760
///
761761
/// This method is safe as it only returns a raw pointer. Dereferencing the
762762
/// pointer is `unsafe`. The caller must ensure that the pointer is not used
763-
/// after the `FixedVec` is dropped or modified.
763+
/// after the [`FixedVec`] is dropped or modified.
764764
pub fn addr_of(&self, index: usize) -> Option<*const W> {
765765
if index >= self.len {
766766
return None;
@@ -937,7 +937,7 @@ where
937937
}
938938
}
939939

940-
/// Allows iterating over a borrowed `FixedVec` (e.g., `for val in &my_vec`).
940+
/// Allows iterating over a borrowed [`FixedVec`] (e.g., `for val in &my_vec`).
941941
impl<'a, T, W, E, B> IntoIterator for &'a FixedVec<T, W, E, B>
942942
where
943943
T: Storable<W>,
@@ -953,7 +953,7 @@ where
953953
}
954954
}
955955

956-
/// Allows iterating over an owned `FixedVec`, consuming it.
956+
/// Allows iterating over an owned [`FixedVec`], consuming it.
957957
impl<T, W, E> IntoIterator for FixedVec<T, W, E, Vec<W>>
958958
where
959959
T: Storable<W> + 'static,
@@ -977,7 +977,7 @@ where
977977
dsi_bitstream::impls::BufBitWriter<E, dsi_bitstream::impls::MemWordWriterVec<W, Vec<W>>>:
978978
dsi_bitstream::prelude::BitWrite<E, Error = std::convert::Infallible>,
979979
{
980-
/// Creates a `FixedVec` by collecting elements from an iterator.
980+
/// Creates a [`FixedVec`] by collecting elements from an iterator.
981981
///
982982
/// The bit width is determined automatically using the [`BitWidth::Minimal`]
983983
/// strategy. This requires collecting the iterator into a temporary `Vec<T>`
@@ -1194,7 +1194,7 @@ where
11941194
///
11951195
/// # Panics
11961196
///
1197-
/// Panics if the new capacity overflows `usize`.
1197+
/// Panics if the new capacity overflows [`usize`].
11981198
///
11991199
/// # Examples
12001200
///
@@ -1662,7 +1662,7 @@ where
16621662
/// # Safety
16631663
///
16641664
/// Modifying the returned slice is logically unsafe. Any change to the bits
1665-
/// can violate the invariants of the `FixedVec`, leading to panics or
1665+
/// can violate the invariants of the [`FixedVec`], leading to panics or
16661666
/// incorrect results on subsequent method calls.
16671667
pub unsafe fn as_mut_limbs(&mut self) -> &mut [W] {
16681668
self.bits.as_mut()
@@ -2211,7 +2211,7 @@ where
22112211
}
22122212
}
22132213

2214-
/// Copies a sequence of elements from a source `FixedVec` into this one.
2214+
/// Copies a sequence of elements from a source [`FixedVec`] into this one.
22152215
///
22162216
/// # Panics
22172217
///
@@ -2300,7 +2300,7 @@ where
23002300
B: AsRef<[W]>,
23012301
B2: AsRef<[W]>,
23022302
{
2303-
/// Checks for equality between two `FixedVec` instances.
2303+
/// Checks for equality between two [`FixedVec`] instances.
23042304
///
23052305
/// It first checks `len` and `bit_width`, then the underlying storage.
23062306
fn eq(&self, other: &FixedVec<T, W, E, B2>) -> bool {
@@ -2311,7 +2311,7 @@ where
23112311
}
23122312
}
23132313

2314-
/// Implements `PartialEq` for comparing a `FixedVec` with a standard slice.
2314+
/// Implements `PartialEq` for comparing a [`FixedVec`] with a standard slice.
23152315
impl<T, W, E, B, T2> PartialEq<&[T2]> for FixedVec<T, W, E, B>
23162316
where
23172317
T: Storable<W> + PartialEq<T2>,
@@ -2356,7 +2356,7 @@ where
23562356
W: Word,
23572357
E: Endianness,
23582358
{
2359-
/// Converts a `Vec`-backed `FixedVec` into a `Box<[]>`-backed `FixedVec`.
2359+
/// Converts a `Vec`-backed [`FixedVec`] into a `Box<[]>`-backed [`FixedVec`].
23602360
fn from(vec: FixedVec<T, W, E, Vec<W>>) -> Self {
23612361
unsafe { Self::new_unchecked(vec.bits.into_boxed_slice(), vec.len, vec.bit_width) }
23622362
}
@@ -2368,7 +2368,7 @@ where
23682368
W: Word,
23692369
E: Endianness,
23702370
{
2371-
/// Converts a `Box<[]>`-backed `FixedVec` into a `Vec`-backed `FixedVec`.
2371+
/// Converts a `Box<[]>`-backed [`FixedVec`] into a `Vec`-backed [`FixedVec`].
23722372
fn from(vec: FixedVec<T, W, E, Box<[W]>>) -> Self {
23732373
unsafe { Self::new_unchecked(vec.bits.into_vec(), vec.len, vec.bit_width) }
23742374
}

0 commit comments

Comments
 (0)