-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use "capacity" as parameter name in with_capacity() methods #60316
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @joshtriplett (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
I've found two more evil rust/src/libstd/sync/mpsc/sync.rs Lines 461 to 479 in 597f432
rust/src/liballoc/collections/vec_deque.rs Lines 87 to 103 in 597f432
|
@bors r+ |
📌 Commit be12ab0 has been approved by |
@bors rollup |
…=joshtriplett Use "capacity" as parameter name in with_capacity() methods See rust-lang#60271. The only place where I didn't change the parameter name is `RawVec`. The problem is that it has a `.cap()` method instead of the usual `.capacity()`: https://github.com/rust-lang/rust/blob/597f432489f12a3f33419daa039ccef11a12c4fd/src/liballoc/raw_vec.rs#L200-L210 Changing this would be a breaking change, and I guess that's not worth it. But since I didn't change `.cap()` there, I didn't change the `cap` parameter name to `capacity`, either.
…=joshtriplett Use "capacity" as parameter name in with_capacity() methods See rust-lang#60271. The only place where I didn't change the parameter name is `RawVec`. The problem is that it has a `.cap()` method instead of the usual `.capacity()`: https://github.com/rust-lang/rust/blob/597f432489f12a3f33419daa039ccef11a12c4fd/src/liballoc/raw_vec.rs#L200-L210 Changing this would be a breaking change, and I guess that's not worth it. But since I didn't change `.cap()` there, I didn't change the `cap` parameter name to `capacity`, either.
…=joshtriplett Use "capacity" as parameter name in with_capacity() methods See rust-lang#60271. The only place where I didn't change the parameter name is `RawVec`. The problem is that it has a `.cap()` method instead of the usual `.capacity()`: https://github.com/rust-lang/rust/blob/597f432489f12a3f33419daa039ccef11a12c4fd/src/liballoc/raw_vec.rs#L200-L210 Changing this would be a breaking change, and I guess that's not worth it. But since I didn't change `.cap()` there, I didn't change the `cap` parameter name to `capacity`, either.
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
☔ The latest upstream changes (presumably #60329) made this pull request unmergeable. Please resolve the merge conflicts. |
Rename .cap() methods to .capacity() As mentioned in rust-lang#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.
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.
See #60271.
The only place where I didn't change the parameter name is
RawVec
. The problem is that it has a.cap()
method instead of the usual.capacity()
:rust/src/liballoc/raw_vec.rs
Lines 200 to 210 in 597f432
Changing this would be a breaking change, and I guess that's not worth it.
But since I didn't change
.cap()
there, I didn't change thecap
parameter name tocapacity
, either.