mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 12:44:40 +00:00
Clarify that VecDeque::swap can panic
The previous documentation mentioned this, but ambiguously used the term "fail". This clarifies that the function will panic if the index is out of bounds, instead of silently failing and not doing anything.
This commit is contained in:
parent
93cdf5e3c4
commit
f1b91f4037
@ -459,10 +459,12 @@ impl<T> VecDeque<T> {
|
|||||||
///
|
///
|
||||||
/// `i` and `j` may be equal.
|
/// `i` and `j` may be equal.
|
||||||
///
|
///
|
||||||
/// Fails if there is no element with either index.
|
|
||||||
///
|
|
||||||
/// Element at index 0 is the front of the queue.
|
/// Element at index 0 is the front of the queue.
|
||||||
///
|
///
|
||||||
|
/// # Panics
|
||||||
|
///
|
||||||
|
/// Panics if either index is out of bounds.
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
Loading…
Reference in New Issue
Block a user