mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 02:00:51 +00:00
Adding in note to the intern docs
This commit is contained in:
parent
aef62bd56c
commit
7b6ef7087e
4
src/cache/intern.rs
vendored
4
src/cache/intern.rs
vendored
@ -68,6 +68,10 @@ cfg_if! {
|
||||
/// However, there is a small cost to this caching, so you shouldn't cache every
|
||||
/// string. Only cache strings which have a high likelihood of being sent
|
||||
/// to JS multiple times.
|
||||
///
|
||||
/// Also, keep in mind that this function is a *performance hint*: it's not
|
||||
/// *guaranteed* that the string will be cached, and the caching strategy
|
||||
/// might change at any time, so don't rely upon it.
|
||||
#[inline]
|
||||
pub fn intern(s: &str) -> &str {
|
||||
#[cfg(feature = "enable-interning")]
|
||||
|
Loading…
x
Reference in New Issue
Block a user