Skip to content

Commit 7b6ef70

Browse files
committed
Adding in note to the intern docs
1 parent aef62bd commit 7b6ef70

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/cache/intern.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ cfg_if! {
6868
/// However, there is a small cost to this caching, so you shouldn't cache every
6969
/// string. Only cache strings which have a high likelihood of being sent
7070
/// to JS multiple times.
71+
///
72+
/// Also, keep in mind that this function is a *performance hint*: it's not
73+
/// *guaranteed* that the string will be cached, and the caching strategy
74+
/// might change at any time, so don't rely upon it.
7175
#[inline]
7276
pub fn intern(s: &str) -> &str {
7377
#[cfg(feature = "enable-interning")]

0 commit comments

Comments
 (0)