about summary refs log tree commit diff
path: root/src/libstd/sys_common
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-04-27 14:12:42 +0200
committerGitHub <noreply@github.com>2019-04-27 14:12:42 +0200
commitfa66b8a1540fc09928630e5d77537d5443c72af4 (patch)
tree13fb0a065979b9f24a7ff84dfcefcf95c8aad128 /src/libstd/sys_common
parent7475db5cfa39438c7e0ef8e0d05d6c286f1ae48d (diff)
parentbe12ab070d733303355d433d68efb870e3da753b (diff)
downloadrust-fa66b8a1540fc09928630e5d77537d5443c72af4.tar.gz
rust-fa66b8a1540fc09928630e5d77537d5443c72af4.zip
Rollup merge of #60316 - mgeier:rename-capacity-parameter, r=joshtriplett
Use "capacity" as parameter name in with_capacity() methods

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()`:

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.
Diffstat (limited to 'src/libstd/sys_common')
-rw-r--r--src/libstd/sys_common/wtf8.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/sys_common/wtf8.rs b/src/libstd/sys_common/wtf8.rs
index f17020de44e..81e606fc165 100644
--- a/src/libstd/sys_common/wtf8.rs
+++ b/src/libstd/sys_common/wtf8.rs
@@ -146,10 +146,10 @@ impl Wtf8Buf {
         Wtf8Buf { bytes: Vec::new() }
     }
 
-    /// Creates a new, empty WTF-8 string with pre-allocated capacity for `n` bytes.
+    /// Creates a new, empty WTF-8 string with pre-allocated capacity for `capacity` bytes.
     #[inline]
-    pub fn with_capacity(n: usize) -> Wtf8Buf {
-        Wtf8Buf { bytes: Vec::with_capacity(n) }
+    pub fn with_capacity(capacity: usize) -> Wtf8Buf {
+        Wtf8Buf { bytes: Vec::with_capacity(capacity) }
     }
 
     /// Creates a WTF-8 string from a UTF-8 `String`.