Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.
  • Loading branch information
dtolnay committed Dec 30, 2021
commit 1f62c24d5a11fcbc3b9d489bcac9492daf7fb82a
8 changes: 4 additions & 4 deletions library/std/src/ffi/os_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down Expand Up @@ -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
Expand All @@ -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]
Expand Down