Skip to content

Commit b192841

Browse files
committed
fix causes of some clippy warnings
Clippy linting had some errors: error: boolean to int conversion using if Error: --> src/builders/module.rs:59:29 | 59 | zend_debug: if PHP_DEBUG { 1 } else { 0 }, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with from: `u8::from(PHP_DEBUG)` | = note: `-D clippy::bool-to-int-with-if` implied by `-D warnings` = note: `PHP_DEBUG as u8` or `PHP_DEBUG.into()` can also be valid options = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_to_int_with_if error: boolean to int conversion using if Error: --> src/builders/module.rs:60:22 | 60 | zts: if PHP_ZTS { 1 } else { 0 }, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with from: `u8::from(PHP_ZTS)` | = note: `PHP_ZTS as u8` or `PHP_ZTS.into()` can also be valid options = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_to_int_with_if error: could not compile `ext-php-rs` due to 2 previous errors This commit tries to fix those.
1 parent 8f1cfec commit b192841

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/builders/module.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ impl ModuleBuilder {
5656
module: ModuleEntry {
5757
size: mem::size_of::<ModuleEntry>() as u16,
5858
zend_api: ZEND_MODULE_API_NO,
59-
zend_debug: if PHP_DEBUG { 1 } else { 0 },
60-
zts: if PHP_ZTS { 1 } else { 0 },
59+
zend_debug: u8::from(PHP_DEBUG),
60+
zts: u8::from(PHP_ZTS),
6161
ini_entry: ptr::null(),
6262
deps: ptr::null(),
6363
name: ptr::null(),

0 commit comments

Comments
 (0)