diff options
| author | bors <bors@rust-lang.org> | 2019-07-25 18:45:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-07-25 18:45:42 +0000 |
| commit | 890881f8f4c77e8670d4b32104c0325fcfefc90f (patch) | |
| tree | 234d6f9b06ed04e6759da3a876f0f0fa281a9b70 /src/libarena | |
| parent | eedf6ce4ef54bb03818ab21d714f1b9f13a6b31c (diff) | |
| parent | abe3bdf257f50b583cd7dea91e33424f700fb0c2 (diff) | |
Auto merge of #60340 - mgeier:cap-vs-capacity, r=alexcrichton
Rename .cap() methods to .capacity() As mentioned in #60316, there are a few `.cap()` methods, which seem out-of-place because such methods are called `.capacity()` in the rest of the code. This PR renames them to `.capacity()` but leaves `RawVec::cap()` in there for backwards compatibility. I didn't try to mark the old version as "deprecated", because I guess this would cause too much noise.
Diffstat (limited to 'src/libarena')
| -rw-r--r-- | src/libarena/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs index a4c6e5b85f9..967b4ad4720 100644 --- a/src/libarena/lib.rs +++ b/src/libarena/lib.rs @@ -99,7 +99,7 @@ impl<T> TypedArenaChunk<T> { // A pointer as large as possible for zero-sized elements. !0 as *mut T } else { - self.start().add(self.storage.cap()) + self.start().add(self.storage.capacity()) } } } @@ -270,7 +270,7 @@ impl<T> TypedArena<T> { self.end.set(last_chunk.end()); return; } else { - new_capacity = last_chunk.storage.cap(); + new_capacity = last_chunk.storage.capacity(); loop { new_capacity = new_capacity.checked_mul(2).unwrap(); if new_capacity >= currently_used_cap + n { @@ -405,7 +405,7 @@ impl DroplessArena { self.end.set(last_chunk.end()); return; } else { - new_capacity = last_chunk.storage.cap(); + new_capacity = last_chunk.storage.capacity(); loop { new_capacity = new_capacity.checked_mul(2).unwrap(); if new_capacity >= used_bytes + needed_bytes { |
