diff options
| author | bors <bors@rust-lang.org> | 2017-08-28 10:42:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-08-28 10:42:11 +0000 |
| commit | 5caca6fa0213cadca1584db43dd71fb5f82b41b9 (patch) | |
| tree | 829208be36495621f723ebc1555c6b104c5375d6 /src/liballoc | |
| parent | a0c3bd2d23f6d08ecf9b4191ee4fff5866a120d1 (diff) | |
| parent | f1b91f4037dc4b3e70912e5a5082be969ddd8e75 (diff) | |
| download | rust-5caca6fa0213cadca1584db43dd71fb5f82b41b9.tar.gz rust-5caca6fa0213cadca1584db43dd71fb5f82b41b9.zip | |
Auto merge of #44114 - daboross:patch-1, r=dtolnay
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. If there's anything else I can do to improve this PR, I'd be happy to do so! Just saw this when reading through the docs in passing - it was slightly unclear what "fail" meant.
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 /// /// ``` |
