Skip to content

Commit

Permalink
take ref instead of cloning
Browse files Browse the repository at this point in the history
  • Loading branch information
Raz-Hemo committed Apr 7, 2024
1 parent 8d3cb4e commit 91d6811
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cached_proc_macro/src/cached.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ pub fn cached(args: TokenStream, input: TokenStream) -> TokenStream {
let old_val = {
#lock
let (result, has_expired) = cache.cache_get_expired(&key);
if let (Some(result), false) = (result.clone(), has_expired) {
if let (Some(result), false) = (&result, has_expired) {
#return_cache_block
}
result
Expand Down

0 comments on commit 91d6811

Please sign in to comment.