Skip to content

Commit

Permalink
Implemented DerefMut for PgRelation
Browse files Browse the repository at this point in the history
  • Loading branch information
YohDeadfall committed Dec 3, 2024
1 parent a0ecc8f commit aaae3c6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pgrx/src/rel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
use pgrx_sql_entity_graph::metadata::{
ArgumentError, Returns, ReturnsError, SqlMapping, SqlTranslatable,
};
use std::ops::Deref;
use std::ops::{Deref, DerefMut};
use std::os::raw::c_char;

pub struct PgRelation {
Expand Down Expand Up @@ -334,6 +334,12 @@ impl Deref for PgRelation {
}
}

impl DerefMut for PgRelation {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.boxed
}
}

impl Drop for PgRelation {
fn drop(&mut self) {
if !self.boxed.is_null() && self.need_close {
Expand Down

0 comments on commit aaae3c6

Please sign in to comment.