Skip to content

Commit

Permalink
fix: mark called_as_trigger as unsafe (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoverbear committed Sep 24, 2021
1 parent 1df09ef commit 1a717ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pgx/src/trigger_support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
use crate::{is_a, pg_sys};

#[inline]
pub fn called_as_trigger(fcinfo: pg_sys::FunctionCallInfo) -> bool {
let fcinfo = unsafe { fcinfo.as_ref() }.expect("fcinfo was null");
!fcinfo.context.is_null() && unsafe { is_a(fcinfo.context, pg_sys::NodeTag_T_TriggerData) }
pub unsafe fn called_as_trigger(fcinfo: pg_sys::FunctionCallInfo) -> bool {
let fcinfo = fcinfo.as_ref().expect("fcinfo was null");
!fcinfo.context.is_null() && is_a(fcinfo.context, pg_sys::NodeTag_T_TriggerData)
}

#[inline]
Expand Down

0 comments on commit 1a717ae

Please sign in to comment.