Skip to content

Commit 84e48a4

Browse files
authored
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.
2 parents 56d11a4 + a877b64 commit 84e48a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/alloc/src/string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ impl String {
10621062
/// let mut output = String::new();
10631063
///
10641064
/// // Pre-reserve the memory, exiting if we can't
1065-
/// output.try_reserve(data.len())?;
1065+
/// output.try_reserve_exact(data.len())?;
10661066
///
10671067
/// // Now we know this can't OOM in the middle of our complex work
10681068
/// output.push_str(data);

0 commit comments

Comments
 (0)