Skip to content

Commit 81e2108

Browse files
committed
OsString: Consolidate all documentation about capacity in top-level docs
1 parent 6506df7 commit 81e2108

File tree

1 file changed

+12
-28
lines changed

1 file changed

+12
-28
lines changed

library/std/src/ffi/os_str.rs

+12-28
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,7 @@ impl OsString {
191191
/// OS strings without reallocating. If `capacity` is 0, the string will not
192192
/// allocate.
193193
///
194-
/// See main `OsString` documentation information about encoding.
195-
///
196-
/// # Notes
197-
///
198-
/// Capacity means UTF-8 byte size for OS strings which created from
199-
/// valid unicode, and not otherwise specified for other contents.
194+
/// See the main `OsString` documentation information about encoding and capacity units.
200195
///
201196
/// # Examples
202197
///
@@ -239,12 +234,7 @@ impl OsString {
239234

240235
/// Returns the capacity this `OsString` can hold without reallocating.
241236
///
242-
/// See `OsString` introduction for information about encoding.
243-
///
244-
/// # Notes
245-
///
246-
/// Capacity means UTF-8 byte size for OS strings which created from
247-
/// valid unicode, and not otherwise specified for other contents.
237+
/// See the main `OsString` documentation information about encoding and capacity units.
248238
///
249239
/// # Examples
250240
///
@@ -266,6 +256,8 @@ impl OsString {
266256
///
267257
/// The collection may reserve more space to avoid frequent reallocations.
268258
///
259+
/// See the main `OsString` documentation information about encoding and capacity units.
260+
///
269261
/// # Examples
270262
///
271263
/// ```
@@ -287,10 +279,7 @@ impl OsString {
287279
/// greater than or equal to `self.len() + additional`. Does nothing if
288280
/// capacity is already sufficient.
289281
///
290-
/// # Notes
291-
///
292-
/// Capacity means UTF-8 byte size for OS strings which created from
293-
/// valid unicode, and not otherwise specified for other contents.
282+
/// See the main `OsString` documentation information about encoding and capacity units.
294283
///
295284
/// # Errors
296285
///
@@ -333,10 +322,7 @@ impl OsString {
333322
///
334323
/// [`reserve`]: OsString::reserve
335324
///
336-
/// # Notes
337-
///
338-
/// Capacity means UTF-8 byte size for OS strings which created from
339-
/// valid unicode, and not otherwise specified for other contents.
325+
/// See the main `OsString` documentation information about encoding and capacity units.
340326
///
341327
/// # Examples
342328
///
@@ -365,10 +351,7 @@ impl OsString {
365351
///
366352
/// [`try_reserve`]: OsString::try_reserve
367353
///
368-
/// # Notes
369-
///
370-
/// Capacity means UTF-8 byte size for OS strings which created from
371-
/// valid unicode, and not otherwise specified for other contents.
354+
/// See the main `OsString` documentation information about encoding and capacity units.
372355
///
373356
/// # Errors
374357
///
@@ -403,6 +386,8 @@ impl OsString {
403386

404387
/// Shrinks the capacity of the `OsString` to match its length.
405388
///
389+
/// See the main `OsString` documentation information about encoding and capacity units.
390+
///
406391
/// # Examples
407392
///
408393
/// ```
@@ -429,10 +414,7 @@ impl OsString {
429414
///
430415
/// If the current capacity is less than the lower limit, this is a no-op.
431416
///
432-
/// # Notes
433-
///
434-
/// Capacity means UTF-8 byte size for OS strings which created from
435-
/// valid unicode, and not otherwise specified for other contents.
417+
/// See the main `OsString` documentation information about encoding and capacity units.
436418
///
437419
/// # Examples
438420
///
@@ -808,6 +790,8 @@ impl OsStr {
808790
/// This number is simply useful for passing to other methods, like
809791
/// [`OsString::with_capacity`] to avoid reallocations.
810792
///
793+
/// See the main `OsString` documentation information about encoding and capacity units.
794+
///
811795
/// # Examples
812796
///
813797
/// ```

0 commit comments

Comments
 (0)