[BUG] build.rs unnecessarily uses mut where the variable is actually immutable #729

Open
opened 2026-01-29 16:52:11 +00:00 by claunia · 0 comments
Owner

Originally created by @abhi-kr-2100 on GitHub (Jan 5, 2023).

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
Originally created by @abhi-kr-2100 on GitHub (Jan 5, 2023). 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 ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#729