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/libcore | |
| 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/libcore')
| -rw-r--r-- | src/libcore/slice/rotate.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/slice/rotate.rs b/src/libcore/slice/rotate.rs index f69b219715a..0437937d769 100644 --- a/src/libcore/slice/rotate.rs +++ b/src/libcore/slice/rotate.rs @@ -16,7 +16,7 @@ union RawArray<T> { } impl<T> RawArray<T> { - fn cap() -> usize { + fn capacity() -> usize { if mem::size_of::<T>() == 0 { usize::max_value() } else { @@ -55,7 +55,7 @@ impl<T> RawArray<T> { pub unsafe fn ptr_rotate<T>(mut left: usize, mid: *mut T, mut right: usize) { loop { let delta = cmp::min(left, right); - if delta <= RawArray::<T>::cap() { + if delta <= RawArray::<T>::capacity() { // We will always hit this immediately for ZST. break; } |
