Skip to content

Commit 4c1a427

Browse files
committed
Add pg macro.
1 parent b8b12ca commit 4c1a427

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

phper/src/macros.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,11 @@ macro_rules! eg {
8383
$crate::sys::executor_globals.$x
8484
};
8585
}
86+
87+
/// Equivalent to the php `PG`.
88+
#[macro_export]
89+
macro_rules! pg {
90+
($x:ident) => {
91+
$crate::sys::core_globals.$x
92+
};
93+
}

phper/src/resources.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ impl Resource {
1414
(ptr as *mut Self).as_mut().expect("ptr should not be null")
1515
}
1616

17+
#[allow(clippy::useless_conversion)]
1718
pub fn handle(&self) -> i64 {
1819
self.inner.handle.into()
1920
}

0 commit comments

Comments
 (0)