Skip to content

Commit

Permalink
Rollup merge of #92388 - SpriteOvO:master, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matthiaskrgr authored Jan 5, 2022
2 parents 56d11a4 + a877b64 commit 84e48a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/alloc/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 84e48a4

Please sign in to comment.