-
Notifications
You must be signed in to change notification settings - Fork 108
Open
Description
Please don't use unwrap, this code:
#[allow(unused_parens)]
pub fn $name($($arg: $argtype),*) -> $ret {
let key = ($($arg.clone()),*);
{
let mut cache = $cachename.lock().unwrap();
let res = $crate::Cached::cache_get(&mut *cache, &key);
if let Some(res) = res { return res.clone(); }
}
let val = (||$body)();
let mut cache = $cachename.lock().unwrap();
$crate::Cached::cache_set(&mut *cache, key, val.clone());
val
}
Metadata
Metadata
Assignees
Labels
No labels