Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix causes of some clippy warnings #152

Merged

Conversation

striezel
Copy link
Contributor

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 PR tries to fix those.

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.
@TobiasBengtsson TobiasBengtsson merged commit 9c5d172 into davidcole1340:master Sep 28, 2022
@striezel striezel deleted the make-clippy-happy branch September 28, 2022 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants