diff options
| author | David Ross <daboross@daboross.net> | 2017-08-27 03:22:53 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-27 03:22:53 -0700 |
| commit | f1b91f4037dc4b3e70912e5a5082be969ddd8e75 (patch) | |
| tree | d02729567bd78267e2133cb5f32d88016ec69059 /src/liballoc | |
| parent | 93cdf5e3c45a0578c79afe8563065d07e5f6984f (diff) | |
| download | rust-f1b91f4037dc4b3e70912e5a5082be969ddd8e75.tar.gz rust-f1b91f4037dc4b3e70912e5a5082be969ddd8e75.zip | |
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.
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/vec_deque.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/liballoc/vec_deque.rs b/src/liballoc/vec_deque.rs index bf906920029..00def2a1eac 100644 --- a/src/liballoc/vec_deque.rs +++ b/src/liballoc/vec_deque.rs @@ -459,10 +459,12 @@ impl<T> VecDeque<T> { /// /// `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. /// + /// # Panics + /// + /// Panics if either index is out of bounds. + /// /// # Examples /// /// ``` |
