[BUG] `build.rs` unnecessarily uses `mut` where the variable is actually immutable
abhi-kr-2100 opened this issue · comments
CCExtractor version: 0.94
Using mut
where the variable is actually never mutated is considered bad practice. Running the ./build
scripts for example, output the following warnings:
Building rust files...
-g -std=gnu99 -Wno-write-strings -Wno-pointer-sign -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP -DGPAC_DISABLE_REMOTERY -DNO_GZIP -DGPAC_HAVE_CONFIG_H -DGPAC_64_BITS
warning: variable does not need to be mutable
--> build.rs:5:9
|
5 | let mut allowlist_functions = vec![
| ----^^^^^^^^^^^^^^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: variable does not need to be mutable
--> build.rs:21:9
|
21 | let mut allowlist_types = vec![
| ----^^^^^^^^^^^^^^^
| |
| help: remove this `mut`
warning: `ccx_rust` (build script) generated 2 warnings
PR #1470 should fix this.
Update: The two variables actually need to be borrowed as mutables.