Skip to content

Commit

Permalink
Optimize get_or
Browse files Browse the repository at this point in the history
  • Loading branch information
terrarier2111 committed Jul 18, 2023
1 parent 7e9be71 commit af03753
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ impl<T: Send> ThreadLocal<T> {
}

#[cold]
fn insert_generator<F: FnOnce() -> Result<T, E>, E>(&self, gen: F) -> &T {
fn insert_generator<F: FnOnce() -> T>(&self, gen: F) -> &T {
let data = gen();
self.insert(data)
}
Expand Down

0 comments on commit af03753

Please sign in to comment.