Rollup merge of #92388 - SpriteOvO:master, r=Mark-Simulacrum
Fix a minor mistake in `String::try_reserve_exact` examples The examples of `String::try_reserve_exact` didn't actually use `try_reserve_exact`, which was probably a minor mistake, and this PR fixed it.
This commit is contained in:
commit
84e48a41d3
1 changed files with 1 additions and 1 deletions
|
@ -1062,7 +1062,7 @@ impl String {
|
|||
/// let mut output = String::new();
|
||||
///
|
||||
/// // Pre-reserve the memory, exiting if we can't
|
||||
/// output.try_reserve(data.len())?;
|
||||
/// output.try_reserve_exact(data.len())?;
|
||||
///
|
||||
/// // Now we know this can't OOM in the middle of our complex work
|
||||
/// output.push_str(data);
|
||||
|
|
Loading…
Add table
Reference in a new issue