Skip to content

Commit

Permalink
Fix a minor mistake in String::try_reserve_exact examples
Browse files Browse the repository at this point in the history
  • Loading branch information
SpriteOvO committed Dec 29, 2021
1 parent 7ae5508 commit a877b64
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 a877b64

Please sign in to comment.