///This is a cached function that uses the [`FOO`] cached static.
fn foo(key: u64, b: u64) -> u64 {
use cached::Cached;
use cached::CloneCached;
let key = (key.clone(), b.clone());
{
let mut cache = FOO.lock().unwrap();
if let Some(result) = cache.cache_get(&key) {
return result.to_owned();
}
}
let result = foo_no_cache(key, b);
let mut cache = FOO.lock().unwrap();
cache.cache_set(key, result.clone());
result
}
Change the proc macro variable name to something else?
Example:
This will expand to
Change the proc macro variable name to something else?