diff options
| author | bors <bors@rust-lang.org> | 2019-04-27 14:06:39 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-04-27 14:06:39 +0000 |
| commit | c751c7a4f47ddc3a9076d1fd45e5d3e557748280 (patch) | |
| tree | 13fb0a065979b9f24a7ff84dfcefcf95c8aad128 /src/liballoc | |
| parent | d4a32d504a5aa49b951bfc70602a9615cb772acf (diff) | |
| parent | fa66b8a1540fc09928630e5d77537d5443c72af4 (diff) | |
| download | rust-c751c7a4f47ddc3a9076d1fd45e5d3e557748280.tar.gz rust-c751c7a4f47ddc3a9076d1fd45e5d3e557748280.zip | |
Auto merge of #60329 - Centril:rollup-wv8g1ex, r=Centril
Rollup of 5 pull requests Successful merges: - #60292 (Replace the `&'tcx List<Ty<'tcx>>` in `TyKind::Tuple` with `SubstsRef<'tcx>`) - #60307 (Make "Implementations on Foreign Types" items in sidebar link to specific impls) - #60309 (Add 1.34.1 release notes) - #60315 (bootstrap: use correct version numbers for llvm-tools and lldb) - #60316 (Use "capacity" as parameter name in with_capacity() methods) Failed merges: r? @ghost
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/collections/vec_deque.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/liballoc/collections/vec_deque.rs b/src/liballoc/collections/vec_deque.rs index 05225e5a25b..d65c24f7350 100644 --- a/src/liballoc/collections/vec_deque.rs +++ b/src/liballoc/collections/vec_deque.rs @@ -369,7 +369,7 @@ impl<T> VecDeque<T> { VecDeque::with_capacity(INITIAL_CAPACITY) } - /// Creates an empty `VecDeque` with space for at least `n` elements. + /// Creates an empty `VecDeque` with space for at least `capacity` elements. /// /// # Examples /// @@ -379,10 +379,10 @@ impl<T> VecDeque<T> { /// let vector: VecDeque<u32> = VecDeque::with_capacity(10); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub fn with_capacity(n: usize) -> VecDeque<T> { + pub fn with_capacity(capacity: usize) -> VecDeque<T> { // +1 since the ringbuffer always leaves one space empty - let cap = cmp::max(n + 1, MINIMUM_CAPACITY + 1).next_power_of_two(); - assert!(cap > n, "capacity overflow"); + let cap = cmp::max(capacity + 1, MINIMUM_CAPACITY + 1).next_power_of_two(); + assert!(cap > capacity, "capacity overflow"); VecDeque { tail: 0, |
