Fix a minor mistake in String::try_reserve_exact examples

This commit is contained in:
Sprite 2021-12-29 13:22:35 +08:00
parent 7ae5508426
commit a877b64717

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