VecDeque { tail: 0, head: 0, buf: RawVec::with_capacity(cap) }
}
- /// Retrieves an element in the `VecDeque` by index.
+ /// Provides a reference to the element at the given index.
///
/// Element at index 0 is the front of the queue.
///
}
}
- /// Retrieves an element in the `VecDeque` mutably by index.
+ /// Provides a mutable reference to the element at the given index.
///
/// Element at index 0 is the front of the queue.
///
}
}
- /// Tries to reserves the minimum capacity for exactly `additional` more elements to
+ /// Tries to reserve the minimum capacity for exactly `additional` more elements to
/// be inserted in the given `VecDeque<T>`. After calling `reserve_exact`,
/// capacity will be greater than or equal to `self.len() + additional`.
/// Does nothing if the capacity is already sufficient.
///
/// # Errors
///
- /// If the capacity overflows, or the allocator reports a failure, then an error
+ /// If the capacity overflows `usize`, or the allocator reports a failure, then an error
/// is returned.
///
/// # Examples
/// // Pre-reserve the memory, exiting if we can't
/// output.try_reserve_exact(data.len())?;
///
- /// // Now we know this can't OOM in the middle of our complex work
+ /// // Now we know this can't OOM(Out-Of-Memory) in the middle of our complex work
/// output.extend(data.iter().map(|&val| {
/// val * 2 + 5 // very complicated
/// }));
///
/// # Errors
///
- /// If the capacity overflows, or the allocator reports a failure, then an error
+ /// If the capacity overflows `usize`, or the allocator reports a failure, then an error
/// is returned.
///
/// # Examples