Skip to content

Commit a877b64

Browse files
committed
Fix a minor mistake in String::try_reserve_exact examples
1 parent 7ae5508 commit a877b64

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)