We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
OsString::reserve_exact
1 parent 4d57d92 commit 5537955Copy full SHA for 5537955
src/libstd/ffi/os_str.rs
@@ -210,6 +210,16 @@ impl OsString {
210
/// Note that the allocator may give the collection more space than it
211
/// requests. Therefore capacity can not be relied upon to be precisely
212
/// minimal. Prefer reserve if future insertions are expected.
213
+ ///
214
+ /// # Examples
215
216
+ /// ```
217
+ /// use std::ffi::OsString;
218
219
+ /// let mut s = OsString::new();
220
+ /// s.reserve_exact(10);
221
+ /// assert!(s.capacity() >= 10);
222
223
#[stable(feature = "osstring_simple_functions", since = "1.9.0")]
224
pub fn reserve_exact(&mut self, additional: usize) {
225
self.inner.reserve_exact(additional)
0 commit comments