diff options
| author | Matthias Geier <Matthias.Geier@gmail.com> | 2019-04-26 18:43:24 +0200 |
|---|---|---|
| committer | Matthias Geier <Matthias.Geier@gmail.com> | 2019-04-26 18:43:24 +0200 |
| commit | be12ab070d733303355d433d68efb870e3da753b (patch) | |
| tree | fd51d36784bd5991bd637631fca0cfb7fa50398b /src/liballoc | |
| parent | 597f432489f12a3f33419daa039ccef11a12c4fd (diff) | |
| download | rust-be12ab070d733303355d433d68efb870e3da753b.tar.gz rust-be12ab070d733303355d433d68efb870e3da753b.zip | |
Use "capacity" as parameter name in with_capacity() methods
Closes #60271.
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, |
