Skip to content

Commit 1f62c24

Browse files
committed
Fix some copy/paste hysteresis in OsString try_reserve docs
It appears `find_max_slow` comes from the BinaryHeap docs, where the try_reserve example is a slow implementation of find_max. It has no relevance to this code in OsString though.
1 parent b07ae1c commit 1f62c24

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/std/src/ffi/os_str.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ impl OsString {
284284
/// use std::ffi::OsString;
285285
/// use std::collections::TryReserveError;
286286
///
287-
/// fn find_max_slow(data: &str) -> Result<OsString, TryReserveError> {
287+
/// fn process_data(data: &str) -> Result<OsString, TryReserveError> {
288288
/// let mut s = OsString::new();
289289
///
290290
/// // Pre-reserve the memory, exiting if we can't
@@ -295,7 +295,7 @@ impl OsString {
295295
///
296296
/// Ok(s)
297297
/// }
298-
/// # find_max_slow("123").expect("why is the test harness OOMing on 12 bytes?");
298+
/// # process_data("123").expect("why is the test harness OOMing on 3 bytes?");
299299
/// ```
300300
#[unstable(feature = "try_reserve_2", issue = "91789")]
301301
#[inline]
@@ -352,7 +352,7 @@ impl OsString {
352352
/// use std::ffi::OsString;
353353
/// use std::collections::TryReserveError;
354354
///
355-
/// fn find_max_slow(data: &str) -> Result<OsString, TryReserveError> {
355+
/// fn process_data(data: &str) -> Result<OsString, TryReserveError> {
356356
/// let mut s = OsString::new();
357357
///
358358
/// // Pre-reserve the memory, exiting if we can't
@@ -363,7 +363,7 @@ impl OsString {
363363
///
364364
/// Ok(s)
365365
/// }
366-
/// # find_max_slow("123").expect("why is the test harness OOMing on 12 bytes?");
366+
/// # process_data("123").expect("why is the test harness OOMing on 3 bytes?");
367367
/// ```
368368
#[unstable(feature = "try_reserve_2", issue = "91789")]
369369
#[inline]

0 commit comments

Comments
 (0)