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:
Matthias Krüger 2022-01-05 15:05:45 +01:00 committed by GitHub
commit 84e48a41d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);