Skip to content

Commit

Permalink
Relax memctx closures from Fn to FnOnce (#390)
Browse files Browse the repository at this point in the history
Signed-off-by: Ana Hobden <[email protected]>
  • Loading branch information
Hoverbear authored Jan 21, 2022
1 parent 20d66a4 commit de8ce98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pgx/src/memcxt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ impl PgMemoryContexts {
/// ```
pub fn switch_to<
R,
F: Fn(&mut PgMemoryContexts) -> R + std::panic::UnwindSafe + std::panic::RefUnwindSafe,
F: FnOnce(&mut PgMemoryContexts) -> R + std::panic::UnwindSafe + std::panic::RefUnwindSafe,
>(
&mut self,
f: F,
Expand Down Expand Up @@ -371,7 +371,7 @@ impl PgMemoryContexts {
/// helper function
fn exec_in_context<
R,
F: Fn(&mut PgMemoryContexts) -> R + std::panic::UnwindSafe + std::panic::RefUnwindSafe,
F: FnOnce(&mut PgMemoryContexts) -> R + std::panic::UnwindSafe + std::panic::RefUnwindSafe,
>(
context: pg_sys::MemoryContext,
f: F,
Expand Down

0 comments on commit de8ce98

Please sign in to comment.