You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is similar to #20 but narrower in scope. The HashMap or LruCache that stores memoized results only requires an owned key when a new value is inserted. Could the memoized function accept a borrowed key which implements Clone or maybe ToOwned? Then if the function signature is fn my_function(key: &String) -> Value the cache could call key.clone() or key.to_owned() only in the case of a cache insert.
The text was updated successfully, but these errors were encountered:
This is similar to #20 but narrower in scope. The
HashMap
orLruCache
that stores memoized results only requires an owned key when a new value is inserted. Could the memoized function accept a borrowed key which implementsClone
or maybeToOwned
? Then if the function signature isfn my_function(key: &String) -> Value
the cache could callkey.clone()
orkey.to_owned()
only in the case of a cache insert.The text was updated successfully, but these errors were encountered: