Skip to content

Commit ccb81f0

Browse files
Merge pull request #143 from TobiasBengtsson/fix-clippy-useless-transmute
Fix clippy errors in nightly - useless transmute, useless ref-deref in Windows build
2 parents b93571e + 993b79e commit ccb81f0

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/builders/class.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,13 @@ impl ClassBuilder {
257257
}
258258

259259
for iface in self.interfaces {
260-
unsafe { zend_do_implement_interface(class, std::mem::transmute(iface)) };
260+
unsafe {
261+
zend_do_implement_interface(
262+
class,
263+
iface as *const crate::ffi::_zend_class_entry
264+
as *mut crate::ffi::_zend_class_entry,
265+
)
266+
};
261267
}
262268

263269
for (name, mut default, flags) in self.properties {

src/types/callable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ impl<'a> ZendCallable<'a> {
115115
let result = unsafe {
116116
_call_user_function_impl(
117117
std::ptr::null_mut(),
118-
std::mem::transmute(self.0.as_ref()),
118+
self.0.as_ref() as *const crate::ffi::_zval_struct as *mut crate::ffi::_zval_struct,
119119
&mut retval,
120120
len as _,
121121
packed.as_ptr() as *mut _,

windows_build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl<'a> PHPProvider<'a> for Provider<'a> {
7070
// this so we need to add it manually.
7171
let php_lib_name = self.get_php_lib_name()?;
7272
for line in bindings.lines() {
73-
match &*line {
73+
match line {
7474
"extern \"C\" {" | "extern \"fastcall\" {" => {
7575
writeln!(writer, "#[link(name = \"{}\")]", php_lib_name)?;
7676
}

0 commit comments

Comments
 (0)