diff options
| author | David Tolnay <dtolnay@gmail.com> | 2021-12-30 12:40:51 -0800 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2021-12-30 12:41:26 -0800 |
| commit | 1f62c24d5a11fcbc3b9d489bcac9492daf7fb82a (patch) | |
| tree | ab6e31441b7307dcc15b1418a980d72f5364b9d6 | |
| parent | b07ae1c4d5232abcb89151eb64d81631d11a5d14 (diff) | |
| download | rust-1f62c24d5a11fcbc3b9d489bcac9492daf7fb82a.tar.gz rust-1f62c24d5a11fcbc3b9d489bcac9492daf7fb82a.zip | |
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.
| -rw-r--r-- | library/std/src/ffi/os_str.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index b3ad3fe8c2c..8424e565569 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -284,7 +284,7 @@ impl OsString { /// use std::ffi::OsString; /// use std::collections::TryReserveError; /// - /// fn find_max_slow(data: &str) -> Result<OsString, TryReserveError> { + /// fn process_data(data: &str) -> Result<OsString, TryReserveError> { /// let mut s = OsString::new(); /// /// // Pre-reserve the memory, exiting if we can't @@ -295,7 +295,7 @@ impl OsString { /// /// Ok(s) /// } - /// # find_max_slow("123").expect("why is the test harness OOMing on 12 bytes?"); + /// # process_data("123").expect("why is the test harness OOMing on 3 bytes?"); /// ``` #[unstable(feature = "try_reserve_2", issue = "91789")] #[inline] @@ -352,7 +352,7 @@ impl OsString { /// use std::ffi::OsString; /// use std::collections::TryReserveError; /// - /// fn find_max_slow(data: &str) -> Result<OsString, TryReserveError> { + /// fn process_data(data: &str) -> Result<OsString, TryReserveError> { /// let mut s = OsString::new(); /// /// // Pre-reserve the memory, exiting if we can't @@ -363,7 +363,7 @@ impl OsString { /// /// Ok(s) /// } - /// # find_max_slow("123").expect("why is the test harness OOMing on 12 bytes?"); + /// # process_data("123").expect("why is the test harness OOMing on 3 bytes?"); /// ``` #[unstable(feature = "try_reserve_2", issue = "91789")] #[inline] |
