heroku / buildpacks-php

Heroku's Cloud Native Buildpack for PHP applications.
BSD 3-Clause "New" or "Revised" License
8 stars 2 forks source link

Fix lint errors with Rust 1.73 and 1.74 #51

Closed edmorley closed 10 months ago

edmorley commented 10 months ago

To unblock #50.

Mostly fixed using cargo clippy --all-targets --fix.

warning: matching over `()` is more explicit
   --> buildpacks/php/src/layers/platform.rs:136:28
    |
136 |                         Ok(_) => {}
    |                            ^ help: use `()` instead of `_`: `()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
note: the lint level is defined here
   --> buildpacks/php/src/main.rs:1:9
    |
1   | #![warn(clippy::pedantic)]
    |         ^^^^^^^^^^^^^^^^
    = note: `#[warn(clippy::ignored_unit_patterns)]` implied by `#[warn(clippy::pedantic)]`

warning: this `.filter_map` can be written more simply using `.filter`
  --> buildpacks/php/src/platform/generator.rs:25:5
   |
25 | /     list.split(sep)
26 | |         .map(str::trim)
27 | |         .filter_map(|p| (!p.is_empty()).then_some(p))
   | |_____________________________________________________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_filter_map
   = note: `#[warn(clippy::unnecessary_filter_map)]` on by default

warning: this argument is a mutable reference, but not used mutably
  --> buildpacks/php/src/package_manager/composer.rs:21:18
   |
21 |     command_env: &mut Env,
   |                  ^^^^^^^^ help: consider changing to: `&Env`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

As seen in (for the Rust 1.73 parts at least): https://github.com/heroku/buildpacks-php/actions/runs/6456037385/job/17524705181?pr=50

GUS-W-14258401.