Skip to content

Commit

Permalink
docs: rm erroneous clone call from "how it works"
Browse files Browse the repository at this point in the history
fixes #239
  • Loading branch information
mightyiam committed Feb 18, 2023
1 parent 6948ba2 commit a67994e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@ fn f(input: Input) -> Output {
static STORE = Mutex::new(#store_init);
let key = #key_expr;
let store_mutex_guard = STORE.lock().unwrap();
let attempt = store_mutex_guard.get(&key).cloned();
let attempt = store_mutex_guard.get(&key);
drop(store_mutex_guard);
if let Some(hit) = attempt {
return hit;
} else {
let miss = #original_fn_body;
STORE.lock().unwrap().insert(key, miss.clone());
let miss = STORE.lock().unwrap().insert(key, miss);
return miss;
};
}
Expand Down

0 comments on commit a67994e

Please sign in to comment.