diff options
| author | Sprite <SpriteOvO@gmail.com> | 2021-12-29 13:22:35 +0800 |
|---|---|---|
| committer | Sprite <SpriteOvO@gmail.com> | 2021-12-29 13:22:35 +0800 |
| commit | a877b647173f5b372146dfad51dea2de5a4d66fe (patch) | |
| tree | 7f9cd1135d27e6159082d3cacf4d88bf430efee0 /library/alloc | |
| parent | 7ae550842635dce84811198446fe87e830de500b (diff) | |
| download | rust-a877b647173f5b372146dfad51dea2de5a4d66fe.tar.gz rust-a877b647173f5b372146dfad51dea2de5a4d66fe.zip | |
Fix a minor mistake in `String::try_reserve_exact` examples
Diffstat (limited to 'library/alloc')
| -rw-r--r-- | library/alloc/src/string.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index b151842458d..7c0faf0659a 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -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); |
