diff options
| author | est31 <MTest31@outlook.com> | 2021-08-05 04:22:14 +0200 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2021-08-05 04:23:54 +0200 |
| commit | 1db8737f658325994026ae103e6952db9bc36780 (patch) | |
| tree | 5d0816060d4c1db050377deafca8d13ddc7e2cdc /library/alloc/src/string.rs | |
| parent | 25b764849625cb090e8b81d12d2bb2295d073788 (diff) | |
alloc: Use intra doc links for the reserve function
The sentence exists to highlight the existence of a performance footgun of repeated calls of the reserve_exact function.
Diffstat (limited to 'library/alloc/src/string.rs')
| -rw-r--r-- | library/alloc/src/string.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 5411316f55a..a6b8bdef89c 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -1035,7 +1035,9 @@ impl String { /// /// Note that the allocator may give the collection more space than it /// requests. Therefore, capacity can not be relied upon to be precisely - /// minimal. Prefer `reserve` if future insertions are expected. + /// minimal. Prefer [`reserve`] if future insertions are expected. + /// + /// [`reserve`]: String::reserve /// /// # Errors /// |
