Skip to content

Commit 692c6bd

Browse files
committed
clippy
1 parent 71c9a45 commit 692c6bd

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

build.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,9 @@ fn check_php_version(info: &PHPInfo) -> Result<()> {
232232

233233
const PHP_84_API_VER: u32 = 20240924;
234234

235-
println!("cargo::rustc-check-cfg=cfg(php80, php81, php82, php83, php84, php_zts, php_debug, docs)");
235+
println!(
236+
"cargo::rustc-check-cfg=cfg(php80, php81, php82, php83, php84, php_zts, php_debug, docs)"
237+
);
236238
println!("cargo:rustc-cfg=php80");
237239

238240
if (PHP_81_API_VER..PHP_82_API_VER).contains(&version) {

src/zend/function.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ impl FunctionEntry {
3939
num_args: 0,
4040
flags: 0,
4141
#[cfg(php84)]
42-
frameless_function_infos: ptr::null(),
42+
doc_comment: ptr::null(),
4343
#[cfg(php84)]
44-
doc_comment: "".as_ptr() as *const c_char,
44+
frameless_function_infos: ptr::null(),
4545
}
4646
}
4747

src/zend/handlers.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,18 @@ impl ZendObjectHandlers {
238238
let mut zv = Zval::new();
239239
val.get(self_, &mut zv)?;
240240

241-
#[cfg(php84)]
242-
#[allow(clippy::unnecessary_mut_passed)]
243-
if zend_is_true(&mut zv) {
244-
return Ok(1);
245-
}
246-
247-
#[cfg(not(php84))]
248-
if zend_is_true(&mut zv) == 1 {
249-
return Ok(1);
241+
cfg_if::cfg_if! {
242+
if #[cfg(php84)] {
243+
#[allow(clippy::unnecessary_mut_passed)]
244+
if zend_is_true(&mut zv) {
245+
return Ok(1);
246+
}
247+
} else {
248+
#[allow(clippy::unnecessary_mut_passed)]
249+
if zend_is_true(&mut zv) == 1 {
250+
return Ok(1);
251+
}
252+
}
250253
}
251254
}
252255
}

0 commit comments

Comments
 (0)